aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin
diff options
context:
space:
mode:
authorJustin Clark-Casey2014-11-19 20:06:56 +0000
committerJustin Clark-Casey2014-11-19 20:06:56 +0000
commit7a2c77e7eace93d722ef37595e9fab21d3cd266f (patch)
treed8e8a4ca5c93654526efd6761995022038977125 /OpenSim/Region/Physics/OdePlugin
parentRemove SOP.StopMoveToTarget scheduled update which is now being done in SOG.s... (diff)
downloadopensim-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 'OpenSim/Region/Physics/OdePlugin')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs6
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs11
2 files changed, 10 insertions, 7 deletions
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; ; } }