aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorubit2013-01-11 17:30:13 +0100
committerubit2013-01-11 17:30:13 +0100
commitf9680d62edcaa171c6b260845809b92e2ea800cd (patch)
tree0e4639c39ee131db45b5838ec0cc732b1e51f6d0 /OpenSim/Region
parentMerge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork (diff)
parentupdate the last information sent in terse updates where they are sent to all (diff)
downloadopensim-SC-f9680d62edcaa171c6b260845809b92e2ea800cd.zip
opensim-SC-f9680d62edcaa171c6b260845809b92e2ea800cd.tar.gz
opensim-SC-f9680d62edcaa171c6b260845809b92e2ea800cd.tar.bz2
opensim-SC-f9680d62edcaa171c6b260845809b92e2ea800cd.tar.xz
Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs19
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs29
2 files changed, 22 insertions, 26 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 4ad8b11..b008e66 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -307,9 +307,6 @@ namespace OpenSim.Region.Framework.Scenes
307 get { return RootPart.VolumeDetectActive; } 307 get { return RootPart.VolumeDetectActive; }
308 } 308 }
309 309
310 private Vector3 lastPhysGroupPos;
311 private Quaternion lastPhysGroupRot;
312
313 private bool m_isBackedUp; 310 private bool m_isBackedUp;
314 311
315 public bool IsBackedUp 312 public bool IsBackedUp
@@ -2525,6 +2522,7 @@ namespace OpenSim.Region.Framework.Scenes
2525 2522
2526 #endregion 2523 #endregion
2527 2524
2525
2528 public override void Update() 2526 public override void Update()
2529 { 2527 {
2530 // Check that the group was not deleted before the scheduled update 2528 // Check that the group was not deleted before the scheduled update
@@ -2543,19 +2541,8 @@ namespace OpenSim.Region.Framework.Scenes
2543 // check to see if the physical position or rotation warrant an update. 2541 // check to see if the physical position or rotation warrant an update.
2544 if (m_rootPart.UpdateFlag == UpdateRequired.NONE) 2542 if (m_rootPart.UpdateFlag == UpdateRequired.NONE)
2545 { 2543 {
2546 bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0); 2544 // rootpart SendScheduledUpdates will check if a update is needed
2547 2545 m_rootPart.UpdateFlag = UpdateRequired.TERSE;
2548 if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f))
2549 {
2550 m_rootPart.UpdateFlag = UpdateRequired.TERSE;
2551 lastPhysGroupPos = AbsolutePosition;
2552 }
2553
2554 if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f))
2555 {
2556 m_rootPart.UpdateFlag = UpdateRequired.TERSE;
2557 lastPhysGroupRot = GroupRotation;
2558 }
2559 } 2546 }
2560 2547
2561 SceneObjectPart[] parts = m_parts.GetArray(); 2548 SceneObjectPart[] parts = m_parts.GetArray();
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 2191cfa..ff4ae85 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -144,7 +144,7 @@ namespace OpenSim.Region.Framework.Scenes
144 /// </remarks> 144 /// </remarks>
145 public bool IsRoot 145 public bool IsRoot
146 { 146 {
147 get { return ParentGroup.RootPart == this; } 147 get { return Object.ReferenceEquals(ParentGroup.RootPart, this); }
148 } 148 }
149 149
150 /// <summary> 150 /// <summary>
@@ -319,7 +319,7 @@ namespace OpenSim.Region.Framework.Scenes
319 protected Vector3 m_lastVelocity; 319 protected Vector3 m_lastVelocity;
320 protected Vector3 m_lastAcceleration; 320 protected Vector3 m_lastAcceleration;
321 protected Vector3 m_lastAngularVelocity; 321 protected Vector3 m_lastAngularVelocity;
322 protected int m_lastTerseSent; 322 protected int m_lastUpdateSentTime;
323 protected float m_buoyancy = 0.0f; 323 protected float m_buoyancy = 0.0f;
324 protected Vector3 m_force; 324 protected Vector3 m_force;
325 protected Vector3 m_torque; 325 protected Vector3 m_torque;
@@ -3198,6 +3198,14 @@ namespace OpenSim.Region.Framework.Scenes
3198 if (ParentGroup == null) 3198 if (ParentGroup == null)
3199 return; 3199 return;
3200 3200
3201 // Update the "last" values
3202 m_lastPosition = OffsetPosition;
3203 m_lastRotation = RotationOffset;
3204 m_lastVelocity = Velocity;
3205 m_lastAcceleration = Acceleration;
3206 m_lastAngularVelocity = AngularVelocity;
3207 m_lastUpdateSentTime = Environment.TickCount;
3208
3201 ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) 3209 ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
3202 { 3210 {
3203 SendFullUpdate(avatar.ControllingClient); 3211 SendFullUpdate(avatar.ControllingClient);
@@ -3271,17 +3279,10 @@ namespace OpenSim.Region.Framework.Scenes
3271 Velocity.ApproxEquals(Vector3.Zero, VELOCITY_TOLERANCE) || 3279 Velocity.ApproxEquals(Vector3.Zero, VELOCITY_TOLERANCE) ||
3272 !AngularVelocity.ApproxEquals(m_lastAngularVelocity, VELOCITY_TOLERANCE) || 3280 !AngularVelocity.ApproxEquals(m_lastAngularVelocity, VELOCITY_TOLERANCE) ||
3273 !OffsetPosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) || 3281 !OffsetPosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) ||
3274 Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) 3282 Environment.TickCount - m_lastUpdateSentTime > TIME_MS_TOLERANCE)
3275 { 3283 {
3276 SendTerseUpdateToAllClients(); 3284 SendTerseUpdateToAllClients();
3277 3285
3278 // Update the "last" values
3279 m_lastPosition = OffsetPosition;
3280 m_lastRotation = RotationOffset;
3281 m_lastVelocity = Velocity;
3282 m_lastAcceleration = Acceleration;
3283 m_lastAngularVelocity = AngularVelocity;
3284 m_lastTerseSent = Environment.TickCount;
3285 } 3286 }
3286 break; 3287 break;
3287 } 3288 }
@@ -3302,6 +3303,14 @@ namespace OpenSim.Region.Framework.Scenes
3302 if (ParentGroup == null || ParentGroup.Scene == null) 3303 if (ParentGroup == null || ParentGroup.Scene == null)
3303 return; 3304 return;
3304 3305
3306 // Update the "last" values
3307 m_lastPosition = OffsetPosition;
3308 m_lastRotation = RotationOffset;
3309 m_lastVelocity = Velocity;
3310 m_lastAcceleration = Acceleration;
3311 m_lastAngularVelocity = AngularVelocity;
3312 m_lastUpdateSentTime = Environment.TickCount;
3313
3305 ParentGroup.Scene.ForEachClient(delegate(IClientAPI client) 3314 ParentGroup.Scene.ForEachClient(delegate(IClientAPI client)
3306 { 3315 {
3307 SendTerseUpdateToClient(client); 3316 SendTerseUpdateToClient(client);