aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Examples/SimpleModule/ComplexObject.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/EntityBase.cs18
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs30
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs8
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Helpers.cs12
6 files changed, 27 insertions, 46 deletions
diff --git a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs
index 0716964..5e87b32 100644
--- a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs
+++ b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs
@@ -69,7 +69,6 @@ namespace OpenSim.Region.Examples.SimpleModule
69 public override void UpdateMovement() 69 public override void UpdateMovement()
70 { 70 {
71 UpdateGroupRotationR(m_rootPart.RotationOffset * m_rotationDirection); 71 UpdateGroupRotationR(m_rootPart.RotationOffset * m_rotationDirection);
72
73 base.UpdateMovement(); 72 base.UpdateMovement();
74 } 73 }
75 74
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
94 set { m_velocity = value; } 94 set { m_velocity = value; }
95 } 95 }
96 96
97 protected Quaternion m_rotation; 97 protected Quaternion m_rotation = new Quaternion(0f, 0f, 1f, 0f);
98 98
99 public virtual Quaternion Rotation 99 public virtual Quaternion Rotation
100 { 100 {
@@ -102,14 +102,6 @@ namespace OpenSim.Region.Framework.Scenes
102 set { m_rotation = value; } 102 set { m_rotation = value; }
103 } 103 }
104 104
105 protected Vector3 m_scale;
106
107 public virtual Vector3 Scale
108 {
109 get { return m_scale; }
110 set { m_scale = value; }
111 }
112
113 protected uint m_localId; 105 protected uint m_localId;
114 106
115 public virtual uint LocalId 107 public virtual uint LocalId
@@ -123,9 +115,13 @@ namespace OpenSim.Region.Framework.Scenes
123 /// </summary> 115 /// </summary>
124 public EntityBase() 116 public EntityBase()
125 { 117 {
126 m_rotation = Quaternion.Identity; 118 m_uuid = UUID.Zero;
127 m_scale = Vector3.One; 119
120 m_pos = Vector3.Zero;
121 m_velocity = Vector3.Zero;
122 Rotation = Quaternion.Identity;
128 m_name = "(basic entity)"; 123 m_name = "(basic entity)";
124 m_rotationalvelocity = Vector3.Zero;
129 } 125 }
130 126
131 /// <summary> 127 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 55ec281..9db2240 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2305,8 +2305,8 @@ namespace OpenSim.Region.Framework.Scenes
2305 "to avatar {0} at position {1}", 2305 "to avatar {0} at position {1}",
2306 sp.UUID.ToString(), grp.AbsolutePosition); 2306 sp.UUID.ToString(), grp.AbsolutePosition);
2307 AttachObject(sp.ControllingClient, 2307 AttachObject(sp.ControllingClient,
2308 grp.LocalId, 0, 2308 grp.LocalId, (uint)0,
2309 grp.Rotation, 2309 grp.GroupRotation,
2310 grp.AbsolutePosition, false); 2310 grp.AbsolutePosition, false);
2311 RootPrim.RemFlag(PrimFlags.TemporaryOnRez); 2311 RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
2312 grp.SendGroupFullUpdate(); 2312 grp.SendGroupFullUpdate();
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 6b4cc0d..9f44f92 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -204,22 +204,9 @@ namespace OpenSim.Region.Framework.Scenes
204 get { return m_parts.Count; } 204 get { return m_parts.Count; }
205 } 205 }
206 206
207 public override Quaternion Rotation 207 public Quaternion GroupRotation
208 { 208 {
209 get { return m_rootPart.RotationOffset; } 209 get { return m_rootPart.RotationOffset; }
210 set { m_rootPart.RotationOffset = value; }
211 }
212
213 public override Vector3 Scale
214 {
215 get { return m_rootPart.Scale; }
216 set { m_rootPart.Scale = value; }
217 }
218
219 public override Vector3 Velocity
220 {
221 get { return m_rootPart.Velocity; }
222 set { m_rootPart.Velocity = value; }
223 } 210 }
224 211
225 public UUID GroupID 212 public UUID GroupID
@@ -548,7 +535,7 @@ namespace OpenSim.Region.Framework.Scenes
548 // Temporary commented to stop compiler warning 535 // Temporary commented to stop compiler warning
549 //Vector3 partPosition = 536 //Vector3 partPosition =
550 // new Vector3(part.AbsolutePosition.X, part.AbsolutePosition.Y, part.AbsolutePosition.Z); 537 // new Vector3(part.AbsolutePosition.X, part.AbsolutePosition.Y, part.AbsolutePosition.Z);
551 Quaternion parentrotation = Rotation; 538 Quaternion parentrotation = GroupRotation;
552 539
553 // Telling the prim to raytrace. 540 // Telling the prim to raytrace.
554 //EntityIntersection inter = part.TestIntersection(hRay, parentrotation); 541 //EntityIntersection inter = part.TestIntersection(hRay, parentrotation);
@@ -1891,17 +1878,14 @@ namespace OpenSim.Region.Framework.Scenes
1891 1878
1892 checkAtTargets(); 1879 checkAtTargets();
1893 1880
1894 Quaternion rot = Rotation; 1881 if (UsePhysics && ((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1)
1895 1882 || (Math.Abs(lastPhysGroupRot.X - GroupRotation.X) > 0.1)
1896 if (UsePhysics && 1883 || (Math.Abs(lastPhysGroupRot.Y - GroupRotation.Y) > 0.1)
1897 ((Math.Abs(lastPhysGroupRot.W - rot.W) > 0.1f) 1884 || (Math.Abs(lastPhysGroupRot.Z - GroupRotation.Z) > 0.1)))
1898 || (Math.Abs(lastPhysGroupRot.X - rot.X) > 0.1f)
1899 || (Math.Abs(lastPhysGroupRot.Y - rot.Y) > 0.1f)
1900 || (Math.Abs(lastPhysGroupRot.Z - rot.Z) > 0.1f)))
1901 { 1885 {
1902 m_rootPart.UpdateFlag = 1; 1886 m_rootPart.UpdateFlag = 1;
1903 1887
1904 lastPhysGroupRot = rot; 1888 lastPhysGroupRot = GroupRotation;
1905 } 1889 }
1906 1890
1907 foreach (SceneObjectPart part in m_parts.Values) 1891 foreach (SceneObjectPart part in m_parts.Values)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 3051609..11ae661 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -2013,10 +2013,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2013 q = avatar.Rotation; // Currently infrequently updated so may be inaccurate 2013 q = avatar.Rotation; // Currently infrequently updated so may be inaccurate
2014 } 2014 }
2015 else 2015 else
2016 q = part.ParentGroup.Rotation; // Likely never get here but just in case 2016 q = part.ParentGroup.GroupRotation; // Likely never get here but just in case
2017 } 2017 }
2018 else 2018 else
2019 q = part.ParentGroup.Rotation; // just the group rotation 2019 q = part.ParentGroup.GroupRotation; // just the group rotation
2020 return new LSL_Rotation(q.X, q.Y, q.Z, q.W); 2020 return new LSL_Rotation(q.X, q.Y, q.Z, q.W);
2021 } 2021 }
2022 q = part.GetWorldRotation(); 2022 q = part.GetWorldRotation();
@@ -7184,10 +7184,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7184 else 7184 else
7185 q = avatar.Rotation; // Currently infrequently updated so may be inaccurate 7185 q = avatar.Rotation; // Currently infrequently updated so may be inaccurate
7186 else 7186 else
7187 q = m_host.ParentGroup.Rotation; // Likely never get here but just in case 7187 q = m_host.ParentGroup.GroupRotation; // Likely never get here but just in case
7188 } 7188 }
7189 else 7189 else
7190 q = m_host.ParentGroup.Rotation; // just the group rotation 7190 q = m_host.ParentGroup.GroupRotation; // just the group rotation
7191 return new LSL_Rotation(q.X, q.Y, q.Z, q.W); 7191 return new LSL_Rotation(q.X, q.Y, q.Z, q.W);
7192 } 7192 }
7193 7193
diff --git a/OpenSim/Region/ScriptEngine/Shared/Helpers.cs b/OpenSim/Region/ScriptEngine/Shared/Helpers.cs
index 84ccafe..4855d64 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Helpers.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Helpers.cs
@@ -218,14 +218,16 @@ namespace OpenSim.Region.ScriptEngine.Shared
218 } 218 }
219 } 219 }
220 220
221 Vector3 absPos = part.AbsolutePosition; 221 Position = new LSL_Types.Vector3(part.AbsolutePosition.X,
222 Position = new LSL_Types.Vector3(absPos.X, absPos.Y, absPos.Z); 222 part.AbsolutePosition.Y,
223 part.AbsolutePosition.Z);
223 224
224 Quaternion wr = part.ParentGroup.Rotation; 225 Quaternion wr = part.ParentGroup.GroupRotation;
225 Rotation = new LSL_Types.Quaternion(wr.X, wr.Y, wr.Z, wr.W); 226 Rotation = new LSL_Types.Quaternion(wr.X, wr.Y, wr.Z, wr.W);
226 227
227 Vector3 vel = part.Velocity; 228 Velocity = new LSL_Types.Vector3(part.Velocity.X,
228 Velocity = new LSL_Types.Vector3(vel.X, vel.Y, vel.Z); 229 part.Velocity.Y,
230 part.Velocity.Z);
229 } 231 }
230 } 232 }
231 233