public ConvextCollisionModifier(ConvexCollisionMask collisionMask, Matrix3D initialMatrix)
        {
            if (collisionMask == null) throw new ArgumentNullException("collisionMask");

            _collisionMask = collisionMask;
            Initialise(collisionMask.World);
            NewtonCollision.ConvexHullModifierMatrix = initialMatrix;
        }
Esempio n. 2
0
        public ConvextCollisionModifier(ConvexCollisionMask collisionMask, Matrix3D initialMatrix)
        {
            if (collisionMask == null)
            {
                throw new ArgumentNullException("collisionMask");
            }

            _collisionMask = collisionMask;
            Initialise(collisionMask.World);
            NewtonCollision.ConvexHullModifierMatrix = initialMatrix;
        }
Esempio n. 3
0
 private static void AddPoints(ConvexCollisionMask collision, List <Point3D> points)
 {
     if (collision is IMesh)
     {
         IList <Point3D> newPoints = ((IMesh)collision).GetPoints();
         if (newPoints != null)
         {
             points.AddRange(newPoints);
         }
     }
     else
     {
         ConvextCollisionModifier modifier = (collision as ConvextCollisionModifier);
         if (modifier != null)
         {
             int i = points.Count; // starting index of new points
             AddPoints(modifier.CollisionMask, points);
             for (int count = points.Count; i < count; i++)
             {
                 points[i] = modifier.ModifierMatrix.Transform(points[i]);
             }
         }
     }
 }
Esempio n. 4
0
 private static void AddPoints(ConvexCollisionMask collision, List<Point3D> points)
 {
     if (collision is IMesh)
     {
         IList<Point3D> newPoints = ((IMesh)collision).GetPoints();
         if (newPoints != null)
             points.AddRange(newPoints);
     }
     else
     {
         ConvextCollisionModifier modifier = (collision as ConvextCollisionModifier);
         if (modifier != null)
         {
             int i = points.Count; // starting index of new points
             AddPoints(modifier.CollisionMask, points);
             for (int count = points.Count; i < count; i++)
                 points[i] = modifier.ModifierMatrix.Transform(points[i]);
         }
     }
 }