From 85c6eb7c500b708ab0a91965eca9da20b0b02e50 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Mon, 23 Jul 2012 10:37:52 -0700 Subject: BulletSim: add all the new functions to BulletSimAPI. Modify ZeroMotion() to not make tainting calls and to use new API calls. --- OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index a749a97..29ddddd 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs @@ -324,11 +324,20 @@ public sealed class BSPrim : PhysicsActor // Set motion values to zero. // Do it to the properties so the values get set in the physics engine. // Push the setting of the values to the viewer. + // Called at taint time! private void ZeroMotion() { - Velocity = OMV.Vector3.Zero; + _velocity = OMV.Vector3.Zero; _acceleration = OMV.Vector3.Zero; - RotationalVelocity = OMV.Vector3.Zero; + _rotationalVelocity = OMV.Vector3.Zero; + + IntPtr obj = BulletSimAPI.GetBodyHandleWorldID2(_scene.WorldID, LocalID); + BulletSimAPI.SetVelocity2(obj, OMV.Vector3.Zero); + BulletSimAPI.SetAngularVelocity2(obj, OMV.Vector3.Zero); + BulletSimAPI.SetInterpolation2(obj, OMV.Vector3.Zero, OMV.Vector3.Zero); + BulletSimAPI.ClearForces2(obj); + + // make sure this new information is pushed to the client base.RequestPhysicsterseUpdate(); } -- cgit v1.1