Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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;
            }
        }
Exemplo n.º 4
0
 Vector3f GetPhysicsOrigin()
 {
     Physics.RigidBodyControl rbc = (Physics.RigidBodyControl)GetController(typeof(Physics.RigidBodyControl));
     return(rbc.Origin);
 }
Exemplo n.º 5
0
 Vector3f GetPhysicsTranslation()
 {
     Physics.RigidBodyControl rbc = (Physics.RigidBodyControl)GetController(typeof(Physics.RigidBodyControl));
     return(rbc.GetTranslation());
 }