BulletSim: small change to use the pointer to the bullet object for zeroing forces.

0.7.4.1
Robert Adams 2012-07-25 10:42:02 -07:00
parent bf6529db32
commit 75f7721b0c
1 changed files with 5 additions and 6 deletions

View File

@ -169,7 +169,7 @@ public sealed class BSPrim : PhysicsActor
_parentPrim = null; _parentPrim = null;
} }
// make sure there are no other prims are linked to me // make sure there are no other prims linked to me
UnlinkAllChildren(); UnlinkAllChildren();
// everything in the C# world will get garbage collected. Tell the C++ world to free stuff. // 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; _rotationalVelocity = OMV.Vector3.Zero;
// Zero some other properties directly into the physics engine // Zero some other properties directly into the physics engine
BulletBody obj = new BulletBody(LocalID, BulletSimAPI.GetBodyHandleWorldID2(_scene.WorldID, LocalID)); BulletSimAPI.SetVelocity2(Body.Ptr, OMV.Vector3.Zero);
BulletSimAPI.SetVelocity2(obj.Ptr, OMV.Vector3.Zero); BulletSimAPI.SetAngularVelocity2(Body.Ptr, OMV.Vector3.Zero);
BulletSimAPI.SetAngularVelocity2(obj.Ptr, OMV.Vector3.Zero); BulletSimAPI.SetInterpolation2(Body.Ptr, OMV.Vector3.Zero, OMV.Vector3.Zero);
BulletSimAPI.SetInterpolation2(obj.Ptr, OMV.Vector3.Zero, OMV.Vector3.Zero); BulletSimAPI.ClearForces2(Body.Ptr);
BulletSimAPI.ClearForces2(obj.Ptr);
} }
public override void LockAngularMotion(OMV.Vector3 axis) public override void LockAngularMotion(OMV.Vector3 axis)