diff options
author | UbitUmarov | 2017-07-18 14:09:30 +0100 |
---|---|---|
committer | UbitUmarov | 2017-07-18 14:09:30 +0100 |
commit | 4293b2cb3cb308b7fcce29ba5fba24d2c41c6ffa (patch) | |
tree | 4a655984fe36a357d04cb12b1c6fdece5bb16f07 /OpenSim/Region/Framework/Scenes | |
parent | KFM: changes on update method implies other changes. Still not that good. Not... (diff) | |
download | opensim-SC_OLD-4293b2cb3cb308b7fcce29ba5fba24d2c41c6ffa.zip opensim-SC_OLD-4293b2cb3cb308b7fcce29ba5fba24d2c41c6ffa.tar.gz opensim-SC_OLD-4293b2cb3cb308b7fcce29ba5fba24d2c41c6ffa.tar.bz2 opensim-SC_OLD-4293b2cb3cb308b7fcce29ba5fba24d2c41c6ffa.tar.xz |
fix object updates throttle for scripts doing motion by direct change of position. Most this scripts are bad, making no use of viewers interpolators. Tanks lotek.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 2384143..f0a3fab 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -810,7 +810,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
810 | { | 810 | { |
811 | // If this is a linkset, we don't want the physics engine mucking up our group position here. | 811 | // If this is a linkset, we don't want the physics engine mucking up our group position here. |
812 | PhysicsActor actor = PhysActor; | 812 | PhysicsActor actor = PhysActor; |
813 | if (ParentID == 0) | 813 | if (_parentID == 0) |
814 | { | 814 | { |
815 | if (actor != null) | 815 | if (actor != null) |
816 | m_groupPosition = actor.Position; | 816 | m_groupPosition = actor.Position; |
@@ -839,7 +839,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
839 | try | 839 | try |
840 | { | 840 | { |
841 | // Root prim actually goes at Position | 841 | // Root prim actually goes at Position |
842 | if (ParentID == 0) | 842 | if (_parentID == 0) |
843 | { | 843 | { |
844 | actor.Position = value; | 844 | actor.Position = value; |
845 | } | 845 | } |
@@ -881,7 +881,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
881 | ParentGroup.InvalidBoundsRadius(); | 881 | ParentGroup.InvalidBoundsRadius(); |
882 | 882 | ||
883 | PhysicsActor actor = PhysActor; | 883 | PhysicsActor actor = PhysActor; |
884 | if (ParentID != 0 && actor != null) | 884 | if (_parentID != 0 && actor != null) |
885 | { | 885 | { |
886 | actor.Position = GetWorldPosition(); | 886 | actor.Position = GetWorldPosition(); |
887 | actor.Orientation = GetWorldRotation(); | 887 | actor.Orientation = GetWorldRotation(); |
@@ -941,7 +941,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
941 | PhysicsActor actor = PhysActor; | 941 | PhysicsActor actor = PhysActor; |
942 | // If this is a root of a linkset, the real rotation is what the physics engine thinks. | 942 | // If this is a root of a linkset, the real rotation is what the physics engine thinks. |
943 | // If not a root prim, the offset rotation is computed by SOG and is relative to the root. | 943 | // If not a root prim, the offset rotation is computed by SOG and is relative to the root. |
944 | if (ParentID == 0 && (Shape.PCode != 9 || Shape.State == 0) && actor != null) | 944 | if (_parentID == 0 && (Shape.PCode != 9 || Shape.State == 0) && actor != null) |
945 | m_rotationOffset = actor.Orientation; | 945 | m_rotationOffset = actor.Orientation; |
946 | 946 | ||
947 | return m_rotationOffset; | 947 | return m_rotationOffset; |
@@ -958,7 +958,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
958 | try | 958 | try |
959 | { | 959 | { |
960 | // Root prim gets value directly | 960 | // Root prim gets value directly |
961 | if (ParentID == 0) | 961 | if (_parentID == 0) |
962 | { | 962 | { |
963 | actor.Orientation = value; | 963 | actor.Orientation = value; |
964 | //m_log.Info("[PART]: RO1:" + actor.Orientation.ToString()); | 964 | //m_log.Info("[PART]: RO1:" + actor.Orientation.ToString()); |
@@ -1259,6 +1259,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1259 | { | 1259 | { |
1260 | get | 1260 | get |
1261 | { | 1261 | { |
1262 | if (_parentID == 0) | ||
1263 | return GroupPosition; | ||
1264 | |||
1262 | return GroupPosition + (m_offsetPosition * ParentGroup.RootPart.RotationOffset); | 1265 | return GroupPosition + (m_offsetPosition * ParentGroup.RootPart.RotationOffset); |
1263 | } | 1266 | } |
1264 | } | 1267 | } |
@@ -2424,7 +2427,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2424 | PhysActor.OnRequestTerseUpdate += PhysicsRequestingTerseUpdate; | 2427 | PhysActor.OnRequestTerseUpdate += PhysicsRequestingTerseUpdate; |
2425 | PhysActor.OnOutOfBounds += PhysicsOutOfBounds; | 2428 | PhysActor.OnOutOfBounds += PhysicsOutOfBounds; |
2426 | 2429 | ||
2427 | if (ParentID != 0 && ParentID != LocalId) | 2430 | if (_parentID != 0 && _parentID != LocalId) |
2428 | { | 2431 | { |
2429 | PhysicsActor parentPa = ParentGroup.RootPart.PhysActor; | 2432 | PhysicsActor parentPa = ParentGroup.RootPart.PhysActor; |
2430 | 2433 | ||
@@ -3075,7 +3078,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3075 | //ParentGroup.RootPart.m_groupPosition = newpos; | 3078 | //ParentGroup.RootPart.m_groupPosition = newpos; |
3076 | } | 3079 | } |
3077 | /* | 3080 | /* |
3078 | if (pa != null && ParentID != 0 && ParentGroup != null) | 3081 | if (pa != null && _parentID != 0 && ParentGroup != null) |
3079 | { | 3082 | { |
3080 | // Special case where a child object is requesting property updates. | 3083 | // Special case where a child object is requesting property updates. |
3081 | // This happens when linksets are modified to use flexible links rather than | 3084 | // This happens when linksets are modified to use flexible links rather than |
@@ -3359,7 +3362,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3359 | return; | 3362 | return; |
3360 | 3363 | ||
3361 | // Update the "last" values | 3364 | // Update the "last" values |
3362 | m_lastPosition = OffsetPosition; | 3365 | m_lastPosition = AbsolutePosition; |
3363 | m_lastRotation = RotationOffset; | 3366 | m_lastRotation = RotationOffset; |
3364 | m_lastVelocity = Velocity; | 3367 | m_lastVelocity = Velocity; |
3365 | m_lastAcceleration = Acceleration; | 3368 | m_lastAcceleration = Acceleration; |
@@ -3378,7 +3381,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3378 | return; | 3381 | return; |
3379 | 3382 | ||
3380 | // Update the "last" values | 3383 | // Update the "last" values |
3381 | m_lastPosition = OffsetPosition; | 3384 | m_lastPosition = AbsolutePosition; |
3382 | m_lastRotation = RotationOffset; | 3385 | m_lastRotation = RotationOffset; |
3383 | m_lastVelocity = Velocity; | 3386 | m_lastVelocity = Velocity; |
3384 | m_lastAcceleration = Acceleration; | 3387 | m_lastAcceleration = Acceleration; |
@@ -3488,7 +3491,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3488 | vz < VELOCITY_TOLERANCE | 3491 | vz < VELOCITY_TOLERANCE |
3489 | ) | 3492 | ) |
3490 | { | 3493 | { |
3491 | if(!OffsetPosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE)) | 3494 | if(!AbsolutePosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE)) |
3492 | break; | 3495 | break; |
3493 | 3496 | ||
3494 | if (vx < 1e-4 && | 3497 | if (vx < 1e-4 && |
@@ -3534,7 +3537,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3534 | { | 3537 | { |
3535 | 3538 | ||
3536 | // Update the "last" values | 3539 | // Update the "last" values |
3537 | m_lastPosition = OffsetPosition; | 3540 | m_lastPosition = AbsolutePosition; |
3538 | m_lastRotation = RotationOffset; | 3541 | m_lastRotation = RotationOffset; |
3539 | m_lastVelocity = curvel; | 3542 | m_lastVelocity = curvel; |
3540 | m_lastAcceleration = curacc; | 3543 | m_lastAcceleration = curacc; |
@@ -3567,7 +3570,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3567 | ClearUpdateSchedule(); | 3570 | ClearUpdateSchedule(); |
3568 | 3571 | ||
3569 | // Update the "last" values | 3572 | // Update the "last" values |
3570 | m_lastPosition = OffsetPosition; | 3573 | m_lastPosition = AbsolutePosition; |
3571 | m_lastRotation = RotationOffset; | 3574 | m_lastRotation = RotationOffset; |
3572 | m_lastVelocity = Velocity; | 3575 | m_lastVelocity = Velocity; |
3573 | m_lastAcceleration = Acceleration; | 3576 | m_lastAcceleration = Acceleration; |
@@ -3588,7 +3591,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3588 | ClearUpdateSchedule(); | 3591 | ClearUpdateSchedule(); |
3589 | 3592 | ||
3590 | // Update the "last" values | 3593 | // Update the "last" values |
3591 | m_lastPosition = OffsetPosition; | 3594 | m_lastPosition = AbsolutePosition; |
3592 | m_lastRotation = RotationOffset; | 3595 | m_lastRotation = RotationOffset; |
3593 | m_lastVelocity = Velocity; | 3596 | m_lastVelocity = Velocity; |
3594 | m_lastAcceleration = Acceleration; | 3597 | m_lastAcceleration = Acceleration; |
@@ -4910,7 +4913,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4910 | pa.OnRequestTerseUpdate += PhysicsRequestingTerseUpdate; | 4913 | pa.OnRequestTerseUpdate += PhysicsRequestingTerseUpdate; |
4911 | pa.OnOutOfBounds += PhysicsOutOfBounds; | 4914 | pa.OnOutOfBounds += PhysicsOutOfBounds; |
4912 | 4915 | ||
4913 | if (ParentID != 0 && ParentID != LocalId) | 4916 | if (_parentID != 0 && _parentID != LocalId) |
4914 | { | 4917 | { |
4915 | PhysicsActor parentPa = ParentGroup.RootPart.PhysActor; | 4918 | PhysicsActor parentPa = ParentGroup.RootPart.PhysActor; |
4916 | 4919 | ||