From 75f7721b0c954f8dc0bbaac6c333aba52e275ea2 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Wed, 25 Jul 2012 10:42:02 -0700 Subject: [PATCH] BulletSim: small change to use the pointer to the bullet object for zeroing forces. --- OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index ff8795518a..6c8ae2e38f 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs @@ -169,7 +169,7 @@ public sealed class BSPrim : PhysicsActor _parentPrim = null; } - // make sure there are no other prims are linked to me + // make sure there are no other prims linked to me UnlinkAllChildren(); // everything in the C# world will get garbage collected. Tell the C++ world to free stuff. @@ -341,11 +341,10 @@ public sealed class BSPrim : PhysicsActor _rotationalVelocity = OMV.Vector3.Zero; // Zero some other properties directly into the physics engine - BulletBody obj = new BulletBody(LocalID, BulletSimAPI.GetBodyHandleWorldID2(_scene.WorldID, LocalID)); - BulletSimAPI.SetVelocity2(obj.Ptr, OMV.Vector3.Zero); - BulletSimAPI.SetAngularVelocity2(obj.Ptr, OMV.Vector3.Zero); - BulletSimAPI.SetInterpolation2(obj.Ptr, OMV.Vector3.Zero, OMV.Vector3.Zero); - BulletSimAPI.ClearForces2(obj.Ptr); + BulletSimAPI.SetVelocity2(Body.Ptr, OMV.Vector3.Zero); + BulletSimAPI.SetAngularVelocity2(Body.Ptr, OMV.Vector3.Zero); + BulletSimAPI.SetInterpolation2(Body.Ptr, OMV.Vector3.Zero, OMV.Vector3.Zero); + BulletSimAPI.ClearForces2(Body.Ptr); } public override void LockAngularMotion(OMV.Vector3 axis)