BulletSim: another round of conversion: dynamics world and collision object functions.

This commit is contained in:
Robert Adams
2012-12-30 10:21:47 -08:00
parent 9fd0e1b080
commit 9218748321
15 changed files with 1454 additions and 1248 deletions

View File

@@ -143,7 +143,7 @@ public sealed class BSShapeCollection : IDisposable
{
if (!BulletSimAPI.IsInWorld2(body.ptr))
{
BulletSimAPI.AddObjectToWorld2(PhysicsScene.World.ptr, body.ptr);
PhysicsScene.PE.AddObjectToWorld(PhysicsScene.World, body);
if (DDetail) DetailLog("{0},BSShapeCollection.ReferenceBody,addedToWorld,ref={1}", body.ID, body);
}
});
@@ -168,12 +168,12 @@ public sealed class BSShapeCollection : IDisposable
if (BulletSimAPI.IsInWorld2(body.ptr))
{
BulletSimAPI.RemoveObjectFromWorld2(PhysicsScene.World.ptr, body.ptr);
PhysicsScene.PE.RemoveObjectFromWorld(PhysicsScene.World, body);
if (DDetail) DetailLog("{0},BSShapeCollection.DereferenceBody,removingFromWorld. Body={1}", body.ID, body);
}
// Zero any reference to the shape so it is not freed when the body is deleted.
BulletSimAPI.SetCollisionShape2(PhysicsScene.World.ptr, body.ptr, IntPtr.Zero);
PhysicsScene.PE.SetCollisionShape(PhysicsScene.World, body, new BulletShape());
PhysicsScene.PE.DestroyObject(PhysicsScene.World, body);
});
}