From d6301db382111bf57a7893215ea84b7e6b09187e Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 2 Oct 2009 00:45:31 +0100 Subject: Revert "* Adding Scale to EntityBase * Fixing the incorrect initialization of EntityBase.Rotation * Removed SceneObjectGroup.GroupRotation and added overrides for Scale/Rotation/Velocity" This reverts commit 39842eb4af3b5a8c52d56c0f7f05ad54f0651bb0. --- OpenSim/Region/Framework/Scenes/EntityBase.cs | 18 +++++-------- OpenSim/Region/Framework/Scenes/Scene.cs | 4 +-- .../Region/Framework/Scenes/SceneObjectGroup.cs | 30 +++++----------------- 3 files changed, 16 insertions(+), 36 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/EntityBase.cs b/OpenSim/Region/Framework/Scenes/EntityBase.cs index 27a0785..c2ec6a5 100644 --- a/OpenSim/Region/Framework/Scenes/EntityBase.cs +++ b/OpenSim/Region/Framework/Scenes/EntityBase.cs @@ -94,7 +94,7 @@ namespace OpenSim.Region.Framework.Scenes set { m_velocity = value; } } - protected Quaternion m_rotation; + protected Quaternion m_rotation = new Quaternion(0f, 0f, 1f, 0f); public virtual Quaternion Rotation { @@ -102,14 +102,6 @@ namespace OpenSim.Region.Framework.Scenes set { m_rotation = value; } } - protected Vector3 m_scale; - - public virtual Vector3 Scale - { - get { return m_scale; } - set { m_scale = value; } - } - protected uint m_localId; public virtual uint LocalId @@ -123,9 +115,13 @@ namespace OpenSim.Region.Framework.Scenes /// public EntityBase() { - m_rotation = Quaternion.Identity; - m_scale = Vector3.One; + m_uuid = UUID.Zero; + + m_pos = Vector3.Zero; + m_velocity = Vector3.Zero; + Rotation = Quaternion.Identity; m_name = "(basic entity)"; + m_rotationalvelocity = Vector3.Zero; } /// diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 0aa587e..05a6f13 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2305,8 +2305,8 @@ namespace OpenSim.Region.Framework.Scenes "to avatar {0} at position {1}", sp.UUID.ToString(), grp.AbsolutePosition); AttachObject(sp.ControllingClient, - grp.LocalId, 0, - grp.Rotation, + grp.LocalId, (uint)0, + grp.GroupRotation, grp.AbsolutePosition, false); RootPrim.RemFlag(PrimFlags.TemporaryOnRez); grp.SendGroupFullUpdate(); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 6807e1b..25489d8 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -204,22 +204,9 @@ namespace OpenSim.Region.Framework.Scenes get { return m_parts.Count; } } - public override Quaternion Rotation + public Quaternion GroupRotation { get { return m_rootPart.RotationOffset; } - set { m_rootPart.RotationOffset = value; } - } - - public override Vector3 Scale - { - get { return m_rootPart.Scale; } - set { m_rootPart.Scale = value; } - } - - public override Vector3 Velocity - { - get { return m_rootPart.Velocity; } - set { m_rootPart.Velocity = value; } } public UUID GroupID @@ -541,7 +528,7 @@ namespace OpenSim.Region.Framework.Scenes // Temporary commented to stop compiler warning //Vector3 partPosition = // new Vector3(part.AbsolutePosition.X, part.AbsolutePosition.Y, part.AbsolutePosition.Z); - Quaternion parentrotation = Rotation; + Quaternion parentrotation = GroupRotation; // Telling the prim to raytrace. //EntityIntersection inter = part.TestIntersection(hRay, parentrotation); @@ -1884,17 +1871,14 @@ namespace OpenSim.Region.Framework.Scenes checkAtTargets(); - Quaternion rot = Rotation; - - if (UsePhysics && - ((Math.Abs(lastPhysGroupRot.W - rot.W) > 0.1f) - || (Math.Abs(lastPhysGroupRot.X - rot.X) > 0.1f) - || (Math.Abs(lastPhysGroupRot.Y - rot.Y) > 0.1f) - || (Math.Abs(lastPhysGroupRot.Z - rot.Z) > 0.1f))) + if (UsePhysics && ((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1) + || (Math.Abs(lastPhysGroupRot.X - GroupRotation.X) > 0.1) + || (Math.Abs(lastPhysGroupRot.Y - GroupRotation.Y) > 0.1) + || (Math.Abs(lastPhysGroupRot.Z - GroupRotation.Z) > 0.1))) { m_rootPart.UpdateFlag = 1; - lastPhysGroupRot = rot; + lastPhysGroupRot = GroupRotation; } foreach (SceneObjectPart part in m_parts.Values) -- cgit v1.1