示例#1
0
        //  Gets the minimum and maximum extents of the triangleVertexes along the axis
        public void GetSpan(out float min, out float max, Vector3 axis)
        {
            float d0 = Vector3.Dot(GetPoint(0), axis);
            float d1 = Vector3.Dot(GetPoint(1), axis);
            float d2 = Vector3.Dot(GetPoint(2), axis);

            min = MyPhysicsUtils.Min(d0, d1, d2);
            max = MyPhysicsUtils.Max(d0, d1, d2);
        }
示例#2
0
        //  Points specified so that pt1-pt0 is edge0 and p2-pt0 is edge1
        public void Update(ref Vector3 vertex0, ref Vector3 vertex1, ref Vector3 vertex2)
        {
            Vertex0 = vertex0;
            Vertex1 = vertex1;
            Vertex2 = vertex2;

            Plane = new MinerWarsMath.Plane(Vertex0, Vertex1, Vertex2);

            m_origin = vertex0;
            m_edge0  = vertex1 - vertex0;
            m_edge1  = vertex2 - vertex0;

            m_normal = Vector3.Cross(m_edge0, m_edge1);
            MyPhysicsUtils.NormalizeSafe(ref m_normal);
        }
示例#3
0
        public MyPhysics()
        {
            physicsSystem = this;

            m_RigidBodyModule = new MyRigidBodyModule();
            m_SensorModule = new MySensorModule();
            m_ContactConstraintModule = new MyContactConstraintModule();

            m_SensorInteractionModule = new MySensorInteractionModule();            

            m_RBInteractionModule = new MyRBInteractionModule();
            m_Utils = new MyPhysicsUtils();

            m_PhysicsObjects = new MyPhysicsObjects();

            m_SimulationHandlers = new List<MyPhysSimulationHandler>(16);
        }