Ejemplo n.º 1
0
		public static Matrix3D EulerAngleToMatrix(Vector3D pEulersAngles)
		{
			NewtonMatrix aNewtonMatrix = new NewtonMatrix(Matrix3D.Identity);
			Newton.NewtonSetEulerAngle(new NewtonVector3(pEulersAngles).NWVector3,
				aNewtonMatrix.NWMatrix);
			return aNewtonMatrix.ToDirectX();
		}
        public void CreateSphere(Vector3D pRadius, Matrix3D pOffsetMatrix)
        {
            NewtonMatrix aMatrix = new NewtonMatrix(pOffsetMatrix);
            m_Handle = Newton.NewtonCreateSphere(m_World.Handle, (float)pRadius.X, (float)pRadius.Y, (float)pRadius.Z, aMatrix.NWMatrix);

            CHashTables.Collision.Add(m_Handle, this);
        }
        public void CreateChamferCylinder(float pRadius, float pHeight, Matrix3D pOffsetMatrix)
        {
            NewtonMatrix aMatrix = new NewtonMatrix(pOffsetMatrix);
            m_Handle = Newton.NewtonCreateChamferCylinder(m_World.Handle,
                pRadius, pHeight, aMatrix.NWMatrix);

            CHashTables.Collision.Add(m_Handle, this);
        }
        public void CreateBox(Vector3D pSize, Matrix3D pOffsetMatrix)
        {
            NewtonMatrix aMatrix = new NewtonMatrix(pOffsetMatrix);
            m_Handle = Newton.NewtonCreateBox(m_World.Handle,
            (float)pSize.X, (float)pSize.Y, (float)pSize.Z, aMatrix.NWMatrix);

            CHashTables.Collision.Add(m_Handle, this);
        }
Ejemplo n.º 5
0
        public void CreateChamferCylinder(float pRadius, float pHeight, Matrix3D pOffsetMatrix)
        {
            NewtonMatrix aMatrix = new NewtonMatrix(pOffsetMatrix);

            m_Handle = Newton.NewtonCreateChamferCylinder(m_World.Handle,
                                                          pRadius, pHeight, aMatrix.NWMatrix);

            CHashTables.Collision.Add(m_Handle, this);
        }
Ejemplo n.º 6
0
        public void CreateBox(Vector3D pSize, Matrix3D pOffsetMatrix)
        {
            NewtonMatrix aMatrix = new NewtonMatrix(pOffsetMatrix);

            m_Handle = Newton.NewtonCreateBox(m_World.Handle,
                                              (float)pSize.X, (float)pSize.Y, (float)pSize.Z, aMatrix.NWMatrix);

            CHashTables.Collision.Add(m_Handle, this);
        }
Ejemplo n.º 7
0
        public void CreateConvexHull(ICollection <Point3D> verticies, Matrix3D pOffsetMatrix)
        {
            float[,] aVertices = new float[verticies.Count, 3];

            int i = 0;

            foreach (Vector3D nextVertice in verticies)
            {
                aVertices[i, 0]   = (float)nextVertice.X;
                aVertices[i, 1]   = (float)nextVertice.Y;
                aVertices[i++, 2] = (float)nextVertice.Z;
            }

            NewtonMatrix aMatrix = new NewtonMatrix(pOffsetMatrix);

            m_Handle = Newton.NewtonCreateConvexHull(m_World.Handle,
                                                     verticies.Count,
                                                     aVertices,
                                                     sizeof(float) * 3,
                                                     aMatrix.NWMatrix);

            CHashTables.Collision.Add(m_Handle, this);
        }
        public void CreateConvexHull(ICollection<Point3D> verticies, Matrix3D pOffsetMatrix)
        {
            float[,] aVertices = new float[verticies.Count, 3];

            int i = 0;
            foreach (Vector3D nextVertice in verticies)
            {
                aVertices[i, 0] = (float)nextVertice.X;
                aVertices[i, 1] = (float)nextVertice.Y;
                aVertices[i++, 2] = (float)nextVertice.Z;
            }

            NewtonMatrix aMatrix = new NewtonMatrix(pOffsetMatrix);
            m_Handle = Newton.NewtonCreateConvexHull(m_World.Handle,
                verticies.Count,
                aVertices,
                sizeof(float) * 3,
                aMatrix.NWMatrix);

            CHashTables.Collision.Add(m_Handle, this);
        }
Ejemplo n.º 9
0
        private void InvokeSetTransform(IntPtr pNewtonBody, float[] pMatrix)
        {
            NewtonMatrix aMatrix = new NewtonMatrix(pMatrix);

            OnSetTransform(new CSetTransformEventArgs(aMatrix.ToDirectX()));
        }
Ejemplo n.º 10
0
 private void InvokeSetTransform(IntPtr pNewtonBody, float[] pMatrix)
 {
     NewtonMatrix aMatrix = new NewtonMatrix(pMatrix);
     OnSetTransform(new CSetTransformEventArgs(aMatrix.ToDirectX()));
 }