aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs56
1 files changed, 36 insertions, 20 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index a260653..6b4cc0d 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -133,7 +133,7 @@ namespace OpenSim.Region.Framework.Scenes
133 /// Is this scene object acting as an attachment? 133 /// Is this scene object acting as an attachment?
134 /// 134 ///
135 /// We return false if the group has already been deleted. 135 /// We return false if the group has already been deleted.
136 /// 136 ///
137 /// TODO: At the moment set must be done on the part itself. There may be a case for doing it here since I 137 /// TODO: At the moment set must be done on the part itself. There may be a case for doing it here since I
138 /// presume either all or no parts in a linkset can be part of an attachment (in which 138 /// presume either all or no parts in a linkset can be part of an attachment (in which
139 /// case the value would get proprogated down into all the descendent parts). 139 /// case the value would get proprogated down into all the descendent parts).
@@ -204,9 +204,22 @@ namespace OpenSim.Region.Framework.Scenes
204 get { return m_parts.Count; } 204 get { return m_parts.Count; }
205 } 205 }
206 206
207 public Quaternion GroupRotation 207 public override Quaternion Rotation
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; }
210 } 223 }
211 224
212 public UUID GroupID 225 public UUID GroupID
@@ -263,7 +276,7 @@ namespace OpenSim.Region.Framework.Scenes
263 if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W) 276 if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W)
264 || m_scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || m_scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S)) 277 || m_scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || m_scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
265 && !IsAttachmentCheckFull()) 278 && !IsAttachmentCheckFull())
266 { 279 {
267 m_scene.CrossPrimGroupIntoNewRegion(val, this, true); 280 m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
268 } 281 }
269 282
@@ -461,7 +474,7 @@ namespace OpenSim.Region.Framework.Scenes
461 /// <param name="scene"></param> 474 /// <param name="scene"></param>
462 public void AttachToScene(Scene scene) 475 public void AttachToScene(Scene scene)
463 { 476 {
464 m_scene = scene; 477 m_scene = scene;
465 RegionHandle = m_scene.RegionInfo.RegionHandle; 478 RegionHandle = m_scene.RegionInfo.RegionHandle;
466 479
467 if (m_rootPart.Shape.PCode != 9 || m_rootPart.Shape.State == 0) 480 if (m_rootPart.Shape.PCode != 9 || m_rootPart.Shape.State == 0)
@@ -486,9 +499,9 @@ namespace OpenSim.Region.Framework.Scenes
486 //m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID); 499 //m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID);
487 } 500 }
488 501
489 ApplyPhysics(m_scene.m_physicalPrim); 502 ApplyPhysics(m_scene.m_physicalPrim);
490 503
491 ScheduleGroupForFullUpdate(); 504 ScheduleGroupForFullUpdate();
492 } 505 }
493 506
494 public Vector3 GroupScale() 507 public Vector3 GroupScale()
@@ -535,7 +548,7 @@ namespace OpenSim.Region.Framework.Scenes
535 // Temporary commented to stop compiler warning 548 // Temporary commented to stop compiler warning
536 //Vector3 partPosition = 549 //Vector3 partPosition =
537 // new Vector3(part.AbsolutePosition.X, part.AbsolutePosition.Y, part.AbsolutePosition.Z); 550 // new Vector3(part.AbsolutePosition.X, part.AbsolutePosition.Y, part.AbsolutePosition.Z);
538 Quaternion parentrotation = GroupRotation; 551 Quaternion parentrotation = Rotation;
539 552
540 // Telling the prim to raytrace. 553 // Telling the prim to raytrace.
541 //EntityIntersection inter = part.TestIntersection(hRay, parentrotation); 554 //EntityIntersection inter = part.TestIntersection(hRay, parentrotation);
@@ -1044,12 +1057,12 @@ namespace OpenSim.Region.Framework.Scenes
1044 m_rootPart = part; 1057 m_rootPart = part;
1045 if (!IsAttachment) 1058 if (!IsAttachment)
1046 part.ParentID = 0; 1059 part.ParentID = 0;
1047 part.LinkNum = 0; 1060 part.LinkNum = 0;
1048 1061
1049 // No locking required since the SOG should not be in the scene yet - one can't change root parts after 1062 // No locking required since the SOG should not be in the scene yet - one can't change root parts after
1050 // the scene object has been attached to the scene 1063 // the scene object has been attached to the scene
1051 m_parts.Add(m_rootPart.UUID, m_rootPart); 1064 m_parts.Add(m_rootPart.UUID, m_rootPart);
1052 } 1065 }
1053 1066
1054 /// <summary> 1067 /// <summary>
1055 /// Add a new part to this scene object. The part must already be correctly configured. 1068 /// Add a new part to this scene object. The part must already be correctly configured.
@@ -1167,7 +1180,7 @@ namespace OpenSim.Region.Framework.Scenes
1167 1180
1168 /// <summary> 1181 /// <summary>
1169 /// Delete this group from its scene and tell all the scene presences about that deletion. 1182 /// Delete this group from its scene and tell all the scene presences about that deletion.
1170 /// </summary> 1183 /// </summary>
1171 /// <param name="silent">Broadcast deletions to all clients.</param> 1184 /// <param name="silent">Broadcast deletions to all clients.</param>
1172 public void DeleteGroup(bool silent) 1185 public void DeleteGroup(bool silent)
1173 { 1186 {
@@ -1274,11 +1287,11 @@ namespace OpenSim.Region.Framework.Scenes
1274 if (part.LocalId != m_rootPart.LocalId) 1287 if (part.LocalId != m_rootPart.LocalId)
1275 { 1288 {
1276 part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), part.VolumeDetectActive, m_physicalPrim); 1289 part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), part.VolumeDetectActive, m_physicalPrim);
1277 } 1290 }
1278 } 1291 }
1279 1292
1280 // Hack to get the physics scene geometries in the right spot 1293 // Hack to get the physics scene geometries in the right spot
1281 ResetChildPrimPhysicsPositions(); 1294 ResetChildPrimPhysicsPositions();
1282 } 1295 }
1283 else 1296 else
1284 { 1297 {
@@ -1501,7 +1514,7 @@ namespace OpenSim.Region.Framework.Scenes
1501 List<SceneObjectPart> partList; 1514 List<SceneObjectPart> partList;
1502 1515
1503 lock (m_parts) 1516 lock (m_parts)
1504 { 1517 {
1505 partList = new List<SceneObjectPart>(m_parts.Values); 1518 partList = new List<SceneObjectPart>(m_parts.Values);
1506 } 1519 }
1507 1520
@@ -1751,7 +1764,7 @@ namespace OpenSim.Region.Framework.Scenes
1751 rootpart.PhysActor.PIDHoverActive = false; 1764 rootpart.PhysActor.PIDHoverActive = false;
1752 } 1765 }
1753 } 1766 }
1754 } 1767 }
1755 } 1768 }
1756 1769
1757 /// <summary> 1770 /// <summary>
@@ -1878,14 +1891,17 @@ namespace OpenSim.Region.Framework.Scenes
1878 1891
1879 checkAtTargets(); 1892 checkAtTargets();
1880 1893
1881 if (UsePhysics && ((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1) 1894 Quaternion rot = Rotation;
1882 || (Math.Abs(lastPhysGroupRot.X - GroupRotation.X) > 0.1) 1895
1883 || (Math.Abs(lastPhysGroupRot.Y - GroupRotation.Y) > 0.1) 1896 if (UsePhysics &&
1884 || (Math.Abs(lastPhysGroupRot.Z - GroupRotation.Z) > 0.1))) 1897 ((Math.Abs(lastPhysGroupRot.W - rot.W) > 0.1f)
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)))
1885 { 1901 {
1886 m_rootPart.UpdateFlag = 1; 1902 m_rootPart.UpdateFlag = 1;
1887 1903
1888 lastPhysGroupRot = GroupRotation; 1904 lastPhysGroupRot = rot;
1889 } 1905 }
1890 1906
1891 foreach (SceneObjectPart part in m_parts.Values) 1907 foreach (SceneObjectPart part in m_parts.Values)