Source Plane

This simple function create a static Physics Plane object. It assumes that m_PhysicsSystem is your JigLib physics system that has previously been setup in your class.

public static Body CreatePhysicsPlane(Vector3 _Pos, Vector3 _Size)
        {
            Body body;
            CollisionSkin collision;

            body = new Body();
            collision = new CollisionSkin(null);

            collision.AddPrimitive(new JigLibX.Geometry.Plane(new Vector3(0.0f,1.0f,0.0f),0.0f),
                                     (int)MaterialTable.MaterialID.UserDefined,
                                     new MaterialProperties(0.2f, 0.7f, 0.6f));

            body.CollisionSkin = collision;
            body.EnableBody();
            body.SetInactive();

            m_PhysicsSystem.AddBody(body);

            return body;
        }
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License