aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorUbitUmarov2017-06-06 20:38:17 +0100
committerUbitUmarov2017-06-06 20:38:17 +0100
commit9011ca8461894f12effba97047718c0801ee7948 (patch)
tree28fd8b7dbc50b70ebb3fceb26affd3c8af15d7fc /OpenSim/Region
parentbug fix: handle current region on GetChildAgentsToClose (diff)
downloadopensim-SC-9011ca8461894f12effba97047718c0801ee7948.zip
opensim-SC-9011ca8461894f12effba97047718c0801ee7948.tar.gz
opensim-SC-9011ca8461894f12effba97047718c0801ee7948.tar.bz2
opensim-SC-9011ca8461894f12effba97047718c0801ee7948.tar.xz
set optional group position and rotation before attach to scene
Diffstat (limited to 'OpenSim/Region')
-rwxr-xr-xOpenSim/Region/Framework/Scenes/SceneGraph.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs15
2 files changed, 6 insertions, 19 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 117d92d..96b8c8b 100755
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -388,19 +388,19 @@ namespace OpenSim.Region.Framework.Scenes
388 public bool AddNewSceneObject( 388 public bool AddNewSceneObject(
389 SceneObjectGroup sceneObject, bool attachToBackup, Vector3? pos, Quaternion? rot, Vector3 vel) 389 SceneObjectGroup sceneObject, bool attachToBackup, Vector3? pos, Quaternion? rot, Vector3 vel)
390 { 390 {
391 AddNewSceneObject(sceneObject, attachToBackup, false);
392
393 if (pos != null) 391 if (pos != null)
394 sceneObject.AbsolutePosition = (Vector3)pos; 392 sceneObject.AbsolutePosition = (Vector3)pos;
395 393
394 if (rot != null)
395 sceneObject.UpdateGroupRotationR((Quaternion)rot);
396
397 AddNewSceneObject(sceneObject, attachToBackup, false);
398
396 if (sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) 399 if (sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim)
397 { 400 {
398 sceneObject.ClearPartAttachmentData(); 401 sceneObject.ClearPartAttachmentData();
399 } 402 }
400 403
401 if (rot != null)
402 sceneObject.UpdateGroupRotationR((Quaternion)rot);
403
404 PhysicsActor pa = sceneObject.RootPart.PhysActor; 404 PhysicsActor pa = sceneObject.RootPart.PhysActor;
405 if (pa != null && pa.IsPhysical && vel != Vector3.Zero) 405 if (pa != null && pa.IsPhysical && vel != Vector3.Zero)
406 { 406 {
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index d980fe5..61aa915 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -941,20 +941,7 @@ namespace OpenSim.Region.Framework.Scenes
941 // If this is a root of a linkset, the real rotation is what the physics engine thinks. 941 // If this is a root of a linkset, the real rotation is what the physics engine thinks.
942 // If not a root prim, the offset rotation is computed by SOG and is relative to the root. 942 // If not a root prim, the offset rotation is computed by SOG and is relative to the root.
943 if (ParentID == 0 && (Shape.PCode != 9 || Shape.State == 0) && actor != null) 943 if (ParentID == 0 && (Shape.PCode != 9 || Shape.State == 0) && actor != null)
944 { 944 m_rotationOffset = actor.Orientation;
945 if (actor.Orientation.X != 0f || actor.Orientation.Y != 0f
946 || actor.Orientation.Z != 0f || actor.Orientation.W != 0f)
947 {
948 m_rotationOffset = actor.Orientation;
949 }
950 }
951
952// float roll, pitch, yaw = 0;
953// m_rotationOffset.GetEulerAngles(out roll, out pitch, out yaw);
954//
955// m_log.DebugFormat(
956// "[SCENE OBJECT PART]: Got euler {0} for RotationOffset on {1} {2}",
957// new Vector3(roll, pitch, yaw), Name, LocalId);
958 945
959 return m_rotationOffset; 946 return m_rotationOffset;
960 } 947 }