public void AddObject(GameObject gameObject, float mass, PhysicsShape physicsShape) { RigidBodyControl rbc = new RigidBodyControl(mass, physicsShape); gameObject.AddController(rbc); world.AddBody(rbc.Body); rbc.Body.EnableDebugDraw = true; rbc.Body.DebugDraw(debugDraw); }
public void AddObject(GameObject gameObject, float mass, PhysicsShape physicsShape) { RigidBodyControl rbc = new RigidBodyControl(mass, physicsShape); gameObject.AddController(rbc); world.AddBody(rbc.Body); rbc.Body.EnableDebugDraw = true; rbc.Body.DebugDraw(debugDraw); }
public void RemoveObject(GameObject gameObject) { RigidBodyControl rbc = (RigidBodyControl)gameObject.GetController(typeof(RigidBodyControl)); if (rbc != null && world.RigidBodies.Contains(rbc.Body)) { world.RemoveBody(rbc.Body); gameObject.RemoveController(rbc); rbc = null; } }
Vector3f GetPhysicsOrigin() { Physics.RigidBodyControl rbc = (Physics.RigidBodyControl)GetController(typeof(Physics.RigidBodyControl)); return(rbc.Origin); }
Vector3f GetPhysicsTranslation() { Physics.RigidBodyControl rbc = (Physics.RigidBodyControl)GetController(typeof(Physics.RigidBodyControl)); return(rbc.GetTranslation()); }