diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 56 |
1 files changed, 36 insertions, 20 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index ad5d56f..6807e1b 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 | ||
@@ -454,7 +467,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
454 | /// <param name="scene"></param> | 467 | /// <param name="scene"></param> |
455 | public void AttachToScene(Scene scene) | 468 | public void AttachToScene(Scene scene) |
456 | { | 469 | { |
457 | m_scene = scene; | 470 | m_scene = scene; |
458 | RegionHandle = m_scene.RegionInfo.RegionHandle; | 471 | RegionHandle = m_scene.RegionInfo.RegionHandle; |
459 | 472 | ||
460 | if (m_rootPart.Shape.PCode != 9 || m_rootPart.Shape.State == 0) | 473 | if (m_rootPart.Shape.PCode != 9 || m_rootPart.Shape.State == 0) |
@@ -479,9 +492,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
479 | //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); | 492 | //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); |
480 | } | 493 | } |
481 | 494 | ||
482 | ApplyPhysics(m_scene.m_physicalPrim); | 495 | ApplyPhysics(m_scene.m_physicalPrim); |
483 | 496 | ||
484 | ScheduleGroupForFullUpdate(); | 497 | ScheduleGroupForFullUpdate(); |
485 | } | 498 | } |
486 | 499 | ||
487 | public Vector3 GroupScale() | 500 | public Vector3 GroupScale() |
@@ -528,7 +541,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
528 | // Temporary commented to stop compiler warning | 541 | // Temporary commented to stop compiler warning |
529 | //Vector3 partPosition = | 542 | //Vector3 partPosition = |
530 | // new Vector3(part.AbsolutePosition.X, part.AbsolutePosition.Y, part.AbsolutePosition.Z); | 543 | // new Vector3(part.AbsolutePosition.X, part.AbsolutePosition.Y, part.AbsolutePosition.Z); |
531 | Quaternion parentrotation = GroupRotation; | 544 | Quaternion parentrotation = Rotation; |
532 | 545 | ||
533 | // Telling the prim to raytrace. | 546 | // Telling the prim to raytrace. |
534 | //EntityIntersection inter = part.TestIntersection(hRay, parentrotation); | 547 | //EntityIntersection inter = part.TestIntersection(hRay, parentrotation); |
@@ -1037,12 +1050,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1037 | m_rootPart = part; | 1050 | m_rootPart = part; |
1038 | if (!IsAttachment) | 1051 | if (!IsAttachment) |
1039 | part.ParentID = 0; | 1052 | part.ParentID = 0; |
1040 | part.LinkNum = 0; | 1053 | part.LinkNum = 0; |
1041 | 1054 | ||
1042 | // No locking required since the SOG should not be in the scene yet - one can't change root parts after | 1055 | // No locking required since the SOG should not be in the scene yet - one can't change root parts after |
1043 | // the scene object has been attached to the scene | 1056 | // the scene object has been attached to the scene |
1044 | m_parts.Add(m_rootPart.UUID, m_rootPart); | 1057 | m_parts.Add(m_rootPart.UUID, m_rootPart); |
1045 | } | 1058 | } |
1046 | 1059 | ||
1047 | /// <summary> | 1060 | /// <summary> |
1048 | /// Add a new part to this scene object. The part must already be correctly configured. | 1061 | /// Add a new part to this scene object. The part must already be correctly configured. |
@@ -1160,7 +1173,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1160 | 1173 | ||
1161 | /// <summary> | 1174 | /// <summary> |
1162 | /// Delete this group from its scene and tell all the scene presences about that deletion. | 1175 | /// Delete this group from its scene and tell all the scene presences about that deletion. |
1163 | /// </summary> | 1176 | /// </summary> |
1164 | /// <param name="silent">Broadcast deletions to all clients.</param> | 1177 | /// <param name="silent">Broadcast deletions to all clients.</param> |
1165 | public void DeleteGroup(bool silent) | 1178 | public void DeleteGroup(bool silent) |
1166 | { | 1179 | { |
@@ -1267,11 +1280,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1267 | if (part.LocalId != m_rootPart.LocalId) | 1280 | if (part.LocalId != m_rootPart.LocalId) |
1268 | { | 1281 | { |
1269 | part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), part.VolumeDetectActive, m_physicalPrim); | 1282 | part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), part.VolumeDetectActive, m_physicalPrim); |
1270 | } | 1283 | } |
1271 | } | 1284 | } |
1272 | 1285 | ||
1273 | // Hack to get the physics scene geometries in the right spot | 1286 | // Hack to get the physics scene geometries in the right spot |
1274 | ResetChildPrimPhysicsPositions(); | 1287 | ResetChildPrimPhysicsPositions(); |
1275 | } | 1288 | } |
1276 | else | 1289 | else |
1277 | { | 1290 | { |
@@ -1494,7 +1507,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1494 | List<SceneObjectPart> partList; | 1507 | List<SceneObjectPart> partList; |
1495 | 1508 | ||
1496 | lock (m_parts) | 1509 | lock (m_parts) |
1497 | { | 1510 | { |
1498 | partList = new List<SceneObjectPart>(m_parts.Values); | 1511 | partList = new List<SceneObjectPart>(m_parts.Values); |
1499 | } | 1512 | } |
1500 | 1513 | ||
@@ -1744,7 +1757,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1744 | rootpart.PhysActor.PIDHoverActive = false; | 1757 | rootpart.PhysActor.PIDHoverActive = false; |
1745 | } | 1758 | } |
1746 | } | 1759 | } |
1747 | } | 1760 | } |
1748 | } | 1761 | } |
1749 | 1762 | ||
1750 | /// <summary> | 1763 | /// <summary> |
@@ -1871,14 +1884,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
1871 | 1884 | ||
1872 | checkAtTargets(); | 1885 | checkAtTargets(); |
1873 | 1886 | ||
1874 | if (UsePhysics && ((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1) | 1887 | Quaternion rot = Rotation; |
1875 | || (Math.Abs(lastPhysGroupRot.X - GroupRotation.X) > 0.1) | 1888 | |
1876 | || (Math.Abs(lastPhysGroupRot.Y - GroupRotation.Y) > 0.1) | 1889 | if (UsePhysics && |
1877 | || (Math.Abs(lastPhysGroupRot.Z - GroupRotation.Z) > 0.1))) | 1890 | ((Math.Abs(lastPhysGroupRot.W - rot.W) > 0.1f) |
1891 | || (Math.Abs(lastPhysGroupRot.X - rot.X) > 0.1f) | ||
1892 | || (Math.Abs(lastPhysGroupRot.Y - rot.Y) > 0.1f) | ||
1893 | || (Math.Abs(lastPhysGroupRot.Z - rot.Z) > 0.1f))) | ||
1878 | { | 1894 | { |
1879 | m_rootPart.UpdateFlag = 1; | 1895 | m_rootPart.UpdateFlag = 1; |
1880 | 1896 | ||
1881 | lastPhysGroupRot = GroupRotation; | 1897 | lastPhysGroupRot = rot; |
1882 | } | 1898 | } |
1883 | 1899 | ||
1884 | foreach (SceneObjectPart part in m_parts.Values) | 1900 | foreach (SceneObjectPart part in m_parts.Values) |