aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
diff options
context:
space:
mode:
authorRobert Adams2013-01-17 14:47:35 -0800
committerRobert Adams2013-01-17 14:47:35 -0800
commit75f710f1e70a3c9d3459d549eb4334a445aca834 (patch)
treec41b93551f101cfd10ea39567f10b759bbf3f355 /OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
parentAdd utility function to clamp a vector to a maximum magnitude. (diff)
downloadopensim-SC_OLD-75f710f1e70a3c9d3459d549eb4334a445aca834.zip
opensim-SC_OLD-75f710f1e70a3c9d3459d549eb4334a445aca834.tar.gz
opensim-SC_OLD-75f710f1e70a3c9d3459d549eb4334a445aca834.tar.bz2
opensim-SC_OLD-75f710f1e70a3c9d3459d549eb4334a445aca834.tar.xz
BulletSim: Add one function that all actors who act on the physical
can use to know if the object is currently active. Code cleaning including use of Util.ClampV function.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
index 821f470..bac0427 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
@@ -139,6 +139,11 @@ public abstract class BSPhysObject : PhysicsActor
139 public abstract bool IsStatic { get; } 139 public abstract bool IsStatic { get; }
140 public abstract bool IsSelected { get; } 140 public abstract bool IsSelected { get; }
141 141
142 // It can be confusing for an actor to know if it should move or update an object
143 // depeneding on the setting of 'selected', 'physical, ...
144 // This flag is the true test -- if true, the object is being acted on in the physical world
145 public abstract bool IsPhysicallyActive { get; }
146
142 // Materialness 147 // Materialness
143 public MaterialAttributes.Material Material { get; private set; } 148 public MaterialAttributes.Material Material { get; private set; }
144 public override void SetMaterial(int material) 149 public override void SetMaterial(int material)
@@ -302,8 +307,9 @@ public abstract class BSPhysObject : PhysicsActor
302 public virtual bool SendCollisions() 307 public virtual bool SendCollisions()
303 { 308 {
304 bool ret = true; 309 bool ret = true;
310
305 // If the 'no collision' call, force it to happen right now so quick collision_end 311 // If the 'no collision' call, force it to happen right now so quick collision_end
306 bool force = (CollisionCollection.Count == 0); 312 bool force = (CollisionCollection.Count == 0 && CollisionsLastTick.Count != 0);
307 313
308 // throttle the collisions to the number of milliseconds specified in the subscription 314 // throttle the collisions to the number of milliseconds specified in the subscription
309 if (force || (PhysicsScene.SimulationNowTime >= NextCollisionOkTime)) 315 if (force || (PhysicsScene.SimulationNowTime >= NextCollisionOkTime))
@@ -318,7 +324,7 @@ public abstract class BSPhysObject : PhysicsActor
318 ret = false; 324 ret = false;
319 } 325 }
320 326
321 // DetailLog("{0},{1}.SendCollisionUpdate,call,numCollisions={2}", LocalID, TypeName, CollisionCollection.Count); 327 DetailLog("{0},{1}.SendCollisionUpdate,call,numCollisions={2}", LocalID, TypeName, CollisionCollection.Count);
322 base.SendCollisionUpdate(CollisionCollection); 328 base.SendCollisionUpdate(CollisionCollection);
323 329
324 // Remember the collisions from this tick for some collision specific processing. 330 // Remember the collisions from this tick for some collision specific processing.