diff options
author | Justin Clark-Casey | 2014-11-19 20:06:56 +0000 |
---|---|---|
committer | Justin Clark-Casey | 2014-11-19 20:06:56 +0000 |
commit | 7a2c77e7eace93d722ef37595e9fab21d3cd266f (patch) | |
tree | d8e8a4ca5c93654526efd6761995022038977125 /OpenSim | |
parent | Remove SOP.StopMoveToTarget scheduled update which is now being done in SOG.s... (diff) | |
download | opensim-SC_OLD-7a2c77e7eace93d722ef37595e9fab21d3cd266f.zip opensim-SC_OLD-7a2c77e7eace93d722ef37595e9fab21d3cd266f.tar.gz opensim-SC_OLD-7a2c77e7eace93d722ef37595e9fab21d3cd266f.tar.bz2 opensim-SC_OLD-7a2c77e7eace93d722ef37595e9fab21d3cd266f.tar.xz |
If calling llStopMoveToTarget() on an in-world prim, don't send an unnecessary object update if the prim was not moving to target.
This involves making PhysicsActor.PIDActive get as well as set.
On physics components that don't implement this (all characters and some phys engines) we return false.
Diffstat (limited to '')
11 files changed, 46 insertions, 21 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 167485e..b2b0002 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1921,12 +1921,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1921 | { | 1921 | { |
1922 | PhysicsActor pa = RootPart.PhysActor; | 1922 | PhysicsActor pa = RootPart.PhysActor; |
1923 | 1923 | ||
1924 | if (pa != null) | 1924 | if (pa != null && pa.PIDActive) |
1925 | { | 1925 | { |
1926 | pa.PIDActive = false; | 1926 | pa.PIDActive = false; |
1927 | 1927 | ||
1928 | ScheduleGroupForTerseUpdate(); | 1928 | ScheduleGroupForTerseUpdate(); |
1929 | //ParentGroup.ScheduleGroupForFullUpdate(); | ||
1930 | } | 1929 | } |
1931 | } | 1930 | } |
1932 | } | 1931 | } |
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs index c1a37cc..43fba7b 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs | |||
@@ -238,6 +238,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin | |||
238 | 238 | ||
239 | public override bool PIDActive | 239 | public override bool PIDActive |
240 | { | 240 | { |
241 | get { return false; } | ||
241 | set { return; } | 242 | set { return; } |
242 | } | 243 | } |
243 | 244 | ||
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPrim.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPrim.cs index 47d7df3..dfe4c19 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPrim.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPrim.cs | |||
@@ -251,6 +251,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin | |||
251 | 251 | ||
252 | public override bool PIDActive | 252 | public override bool PIDActive |
253 | { | 253 | { |
254 | get { return false; } | ||
254 | set { return; } | 255 | set { return; } |
255 | } | 256 | } |
256 | 257 | ||
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs index 9b56fb4..a303972 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | |||
@@ -614,9 +614,9 @@ public sealed class BSCharacter : BSPhysObject | |||
614 | public override OMV.Vector3 PIDTarget { | 614 | public override OMV.Vector3 PIDTarget { |
615 | set { _PIDTarget = value; } | 615 | set { _PIDTarget = value; } |
616 | } | 616 | } |
617 | public override bool PIDActive { | 617 | |
618 | set { _usePID = value; } | 618 | public override bool PIDActive { get; set; } |
619 | } | 619 | |
620 | public override float PIDTau { | 620 | public override float PIDTau { |
621 | set { _PIDTau = value; } | 621 | set { _PIDTau = value; } |
622 | } | 622 | } |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs index 75ffeb4..f059322 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | |||
@@ -246,7 +246,12 @@ public abstract class BSPhysObject : PhysicsActor | |||
246 | 246 | ||
247 | public virtual bool ForceBodyShapeRebuild(bool inTaintTime) { return false; } | 247 | public virtual bool ForceBodyShapeRebuild(bool inTaintTime) { return false; } |
248 | 248 | ||
249 | public override bool PIDActive { set { MoveToTargetActive = value; } } | 249 | public override bool PIDActive |
250 | { | ||
251 | get { return MoveToTargetActive; } | ||
252 | set { MoveToTargetActive = value; } | ||
253 | } | ||
254 | |||
250 | public override OMV.Vector3 PIDTarget { set { MoveToTargetTarget = value; } } | 255 | public override OMV.Vector3 PIDTarget { set { MoveToTargetTarget = value; } } |
251 | public override float PIDTau { set { MoveToTargetTau = value; } } | 256 | public override float PIDTau { set { MoveToTargetTau = value; } } |
252 | 257 | ||
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index edec949..27ee5ac 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | |||
@@ -1087,9 +1087,17 @@ public class BSPrim : BSPhysObject | |||
1087 | } | 1087 | } |
1088 | } | 1088 | } |
1089 | 1089 | ||
1090 | public override bool PIDActive { | 1090 | public override bool PIDActive |
1091 | set { | 1091 | { |
1092 | base.MoveToTargetActive = value; | 1092 | get |
1093 | { | ||
1094 | return MoveToTargetActive; | ||
1095 | } | ||
1096 | |||
1097 | set | ||
1098 | { | ||
1099 | MoveToTargetActive = value; | ||
1100 | |||
1093 | EnableActor(MoveToTargetActive, MoveToTargetActorName, delegate() | 1101 | EnableActor(MoveToTargetActive, MoveToTargetActorName, delegate() |
1094 | { | 1102 | { |
1095 | return new BSActorMoveToTarget(PhysScene, this, MoveToTargetActorName); | 1103 | return new BSActorMoveToTarget(PhysScene, this, MoveToTargetActorName); |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index 1750853..6bc6e23 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs | |||
@@ -291,7 +291,7 @@ namespace OpenSim.Region.Physics.Manager | |||
291 | 291 | ||
292 | // Used for MoveTo | 292 | // Used for MoveTo |
293 | public abstract Vector3 PIDTarget { set; } | 293 | public abstract Vector3 PIDTarget { set; } |
294 | public abstract bool PIDActive { set;} | 294 | public abstract bool PIDActive { get; set; } |
295 | public abstract float PIDTau { set; } | 295 | public abstract float PIDTau { set; } |
296 | 296 | ||
297 | // Used for llSetHoverHeight and maybe vehicle height | 297 | // Used for llSetHoverHeight and maybe vehicle height |
@@ -545,7 +545,13 @@ namespace OpenSim.Region.Physics.Manager | |||
545 | } | 545 | } |
546 | 546 | ||
547 | public override Vector3 PIDTarget { set { return; } } | 547 | public override Vector3 PIDTarget { set { return; } } |
548 | public override bool PIDActive { set { return; } } | 548 | |
549 | public override bool PIDActive | ||
550 | { | ||
551 | get { return false; } | ||
552 | set { return; } | ||
553 | } | ||
554 | |||
549 | public override float PIDTau { set { return; } } | 555 | public override float PIDTau { set { return; } } |
550 | 556 | ||
551 | public override float PIDHoverHeight { set { return; } } | 557 | public override float PIDHoverHeight { set { return; } } |
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 8f37b79..67503df 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |||
@@ -1245,7 +1245,11 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1245 | } | 1245 | } |
1246 | 1246 | ||
1247 | public override Vector3 PIDTarget { set { return; } } | 1247 | public override Vector3 PIDTarget { set { return; } } |
1248 | public override bool PIDActive { set { return; } } | 1248 | public override bool PIDActive |
1249 | { | ||
1250 | get { return false; } | ||
1251 | set { return; } | ||
1252 | } | ||
1249 | public override float PIDTau { set { return; } } | 1253 | public override float PIDTau { set { return; } } |
1250 | 1254 | ||
1251 | public override float PIDHoverHeight { set { return; } } | 1255 | public override float PIDHoverHeight { set { return; } } |
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 13c69d6..e347fdc 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | |||
@@ -114,7 +114,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
114 | private float m_PIDTau; | 114 | private float m_PIDTau; |
115 | private float PID_D = 35f; | 115 | private float PID_D = 35f; |
116 | private float PID_G = 25f; | 116 | private float PID_G = 25f; |
117 | private bool m_usePID; | ||
118 | 117 | ||
119 | // KF: These next 7 params apply to llSetHoverHeight(float height, integer water, float tau), | 118 | // KF: These next 7 params apply to llSetHoverHeight(float height, integer water, float tau), |
120 | // and are for non-VEHICLES only. | 119 | // and are for non-VEHICLES only. |
@@ -1723,7 +1722,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
1723 | // gravityz multiplier = 1 - m_buoyancy | 1722 | // gravityz multiplier = 1 - m_buoyancy |
1724 | fz = _parent_scene.gravityz * (1.0f - m_buoyancy) * m_mass; | 1723 | fz = _parent_scene.gravityz * (1.0f - m_buoyancy) * m_mass; |
1725 | 1724 | ||
1726 | if (m_usePID) | 1725 | if (PIDActive) |
1727 | { | 1726 | { |
1728 | //Console.WriteLine("PID " + Name); | 1727 | //Console.WriteLine("PID " + Name); |
1729 | // KF - this is for object move? eg. llSetPos() ? | 1728 | // KF - this is for object move? eg. llSetPos() ? |
@@ -1792,10 +1791,10 @@ Console.WriteLine(" JointCreateFixed"); | |||
1792 | 1791 | ||
1793 | fz = fz + ((_target_velocity.Z - vel.Z) * (PID_D) * m_mass); | 1792 | fz = fz + ((_target_velocity.Z - vel.Z) * (PID_D) * m_mass); |
1794 | } | 1793 | } |
1795 | } // end if (m_usePID) | 1794 | } // end if (PIDActive) |
1796 | 1795 | ||
1797 | // Hover PID Controller needs to be mutually exlusive to MoveTo PID controller | 1796 | // Hover PID Controller needs to be mutually exlusive to MoveTo PID controller |
1798 | if (m_useHoverPID && !m_usePID) | 1797 | if (m_useHoverPID && !PIDActive) |
1799 | { | 1798 | { |
1800 | //Console.WriteLine("Hover " + Name); | 1799 | //Console.WriteLine("Hover " + Name); |
1801 | 1800 | ||
@@ -2866,7 +2865,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
2866 | // it does make sense to do this for tiny little instabilities with physical prim, however 0.5m/frame is fairly large. | 2865 | // it does make sense to do this for tiny little instabilities with physical prim, however 0.5m/frame is fairly large. |
2867 | // reducing this to 0.02m/frame seems to help the angular rubberbanding quite a bit, however, to make sure it doesn't affect elevators and vehicles | 2866 | // reducing this to 0.02m/frame seems to help the angular rubberbanding quite a bit, however, to make sure it doesn't affect elevators and vehicles |
2868 | // adding these logical exclusion situations to maintain this where I think it was intended to be. | 2867 | // adding these logical exclusion situations to maintain this where I think it was intended to be. |
2869 | if (m_throttleUpdates || m_usePID || (m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE) || (Amotor != IntPtr.Zero)) | 2868 | if (m_throttleUpdates || PIDActive || (m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE) || (Amotor != IntPtr.Zero)) |
2870 | { | 2869 | { |
2871 | m_minvelocity = 0.5f; | 2870 | m_minvelocity = 0.5f; |
2872 | } | 2871 | } |
@@ -2947,7 +2946,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
2947 | m_log.WarnFormat("[PHYSICS]: Got NaN PIDTarget from Scene on Object {0}", Name); | 2946 | m_log.WarnFormat("[PHYSICS]: Got NaN PIDTarget from Scene on Object {0}", Name); |
2948 | } | 2947 | } |
2949 | } | 2948 | } |
2950 | public override bool PIDActive { set { m_usePID = value; } } | 2949 | public override bool PIDActive { get; set; } |
2951 | public override float PIDTau { set { m_PIDTau = value; } } | 2950 | public override float PIDTau { set { m_PIDTau = value; } } |
2952 | 2951 | ||
2953 | public override float PIDHoverHeight { set { m_PIDHoverHeight = value; ; } } | 2952 | public override float PIDHoverHeight { set { m_PIDHoverHeight = value; ; } } |
diff --git a/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs b/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs index ae534ea..40ab984 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs +++ b/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs | |||
@@ -273,9 +273,10 @@ namespace OpenSim.Region.Physics.POSPlugin | |||
273 | set { return; } | 273 | set { return; } |
274 | } | 274 | } |
275 | 275 | ||
276 | public override bool PIDActive | 276 | public override bool PIDActive |
277 | { | 277 | { |
278 | set { return; } | 278 | get { return false; } |
279 | set { return; } | ||
279 | } | 280 | } |
280 | 281 | ||
281 | public override float PIDTau | 282 | public override float PIDTau |
diff --git a/OpenSim/Region/Physics/POSPlugin/POSPrim.cs b/OpenSim/Region/Physics/POSPlugin/POSPrim.cs index e4fd7eb..7c1e915 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSPrim.cs +++ b/OpenSim/Region/Physics/POSPlugin/POSPrim.cs | |||
@@ -270,6 +270,7 @@ namespace OpenSim.Region.Physics.POSPlugin | |||
270 | 270 | ||
271 | public override bool PIDActive | 271 | public override bool PIDActive |
272 | { | 272 | { |
273 | get { return false; } | ||
273 | set { return; } | 274 | set { return; } |
274 | } | 275 | } |
275 | 276 | ||