aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
diff options
context:
space:
mode:
authorRobert Adams2012-12-21 13:35:44 -0800
committerRobert Adams2012-12-21 13:35:44 -0800
commitae4d932e7f00e781db9c9cdd5c29efc51e2425fb (patch)
treeb03beb291cd35d4227fb82baf04ce14512b859eb /OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
parentBulletSim: small fix to avatar movement motor use which keeps avatar from fly... (diff)
downloadopensim-SC-ae4d932e7f00e781db9c9cdd5c29efc51e2425fb.zip
opensim-SC-ae4d932e7f00e781db9c9cdd5c29efc51e2425fb.tar.gz
opensim-SC-ae4d932e7f00e781db9c9cdd5c29efc51e2425fb.tar.bz2
opensim-SC-ae4d932e7f00e781db9c9cdd5c29efc51e2425fb.tar.xz
BulletSim: Move all the parameter variables, tables and get and fetch logic to a separate, static class for easier addition and to remove all that bulk from the BSScene class.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs26
1 files changed, 11 insertions, 15 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
index 68a0db6..e43bf8e 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
@@ -720,10 +720,10 @@ public sealed class BSPrim : BSPhysObject
720 // Mass is zero which disables a bunch of physics stuff in Bullet 720 // Mass is zero which disables a bunch of physics stuff in Bullet
721 UpdatePhysicalMassProperties(0f); 721 UpdatePhysicalMassProperties(0f);
722 // Set collision detection parameters 722 // Set collision detection parameters
723 if (PhysicsScene.Params.ccdMotionThreshold > 0f) 723 if (BSParam.CcdMotionThreshold > 0f)
724 { 724 {
725 BulletSimAPI.SetCcdMotionThreshold2(PhysBody.ptr, PhysicsScene.Params.ccdMotionThreshold); 725 BulletSimAPI.SetCcdMotionThreshold2(PhysBody.ptr, BSParam.CcdMotionThreshold);
726 BulletSimAPI.SetCcdSweptSphereRadius2(PhysBody.ptr, PhysicsScene.Params.ccdSweptSphereRadius); 726 BulletSimAPI.SetCcdSweptSphereRadius2(PhysBody.ptr, BSParam.CcdSweptSphereRadius);
727 } 727 }
728 728
729 // The activation state is 'disabled' so Bullet will not try to act on it. 729 // The activation state is 'disabled' so Bullet will not try to act on it.
@@ -761,17 +761,17 @@ public sealed class BSPrim : BSPhysObject
761 UpdatePhysicalMassProperties(RawMass); 761 UpdatePhysicalMassProperties(RawMass);
762 762
763 // Set collision detection parameters 763 // Set collision detection parameters
764 if (PhysicsScene.Params.ccdMotionThreshold > 0f) 764 if (BSParam.CcdMotionThreshold > 0f)
765 { 765 {
766 BulletSimAPI.SetCcdMotionThreshold2(PhysBody.ptr, PhysicsScene.Params.ccdMotionThreshold); 766 BulletSimAPI.SetCcdMotionThreshold2(PhysBody.ptr, BSParam.CcdMotionThreshold);
767 BulletSimAPI.SetCcdSweptSphereRadius2(PhysBody.ptr, PhysicsScene.Params.ccdSweptSphereRadius); 767 BulletSimAPI.SetCcdSweptSphereRadius2(PhysBody.ptr, BSParam.CcdSweptSphereRadius);
768 } 768 }
769 769
770 // Various values for simulation limits 770 // Various values for simulation limits
771 BulletSimAPI.SetDamping2(PhysBody.ptr, PhysicsScene.Params.linearDamping, PhysicsScene.Params.angularDamping); 771 BulletSimAPI.SetDamping2(PhysBody.ptr, BSParam.LinearDamping, BSParam.AngularDamping);
772 BulletSimAPI.SetDeactivationTime2(PhysBody.ptr, PhysicsScene.Params.deactivationTime); 772 BulletSimAPI.SetDeactivationTime2(PhysBody.ptr, BSParam.DeactivationTime);
773 BulletSimAPI.SetSleepingThresholds2(PhysBody.ptr, PhysicsScene.Params.linearSleepingThreshold, PhysicsScene.Params.angularSleepingThreshold); 773 BulletSimAPI.SetSleepingThresholds2(PhysBody.ptr, BSParam.LinearSleepingThreshold, BSParam.AngularSleepingThreshold);
774 BulletSimAPI.SetContactProcessingThreshold2(PhysBody.ptr, PhysicsScene.Params.contactProcessingThreshold); 774 BulletSimAPI.SetContactProcessingThreshold2(PhysBody.ptr, BSParam.ContactProcessingThreshold);
775 775
776 // This collides like an object. 776 // This collides like an object.
777 PhysBody.collisionType = CollisionType.Dynamic; 777 PhysBody.collisionType = CollisionType.Dynamic;
@@ -1361,11 +1361,7 @@ public sealed class BSPrim : BSPhysObject
1361 } 1361 }
1362 */ 1362 */
1363 1363
1364 if (returnMass <= 0) 1364 returnMass = Util.Clamp(returnMass, BSParam.MinimumObjectMass, BSParam.MaximumObjectMass);
1365 returnMass = 0.0001f;
1366
1367 if (returnMass > PhysicsScene.MaximumObjectMass)
1368 returnMass = PhysicsScene.MaximumObjectMass;
1369 1365
1370 return returnMass; 1366 return returnMass;
1371 }// end CalculateMass 1367 }// end CalculateMass