Exemplo n.º 1
0
 bool GetTriangleData(int triangleID, bool applyWorldTransform, Vector3F[] vertices, int[] indices, out Triangle triangle)
 {
     if (applyWorldTransform)
     {
         var t     = ParentRigidBody.Transform.Value.ToMatrix4();
         var local = TransformRelativeToParent.Value;
         if (local != null && !local.IsIdentity)
         {
             t *= local.ToMatrix4();
         }
         return(MathAlgorithms.GetTriangleData(triangleID, ref t, vertices, indices, out triangle));
     }
     else
     {
         return(MathAlgorithms.GetTriangleData(triangleID, null, vertices, indices, out triangle));
     }
 }
Exemplo n.º 2
0
 public bool GetTriangleProcessedData(int triangleID, bool applyWorldTransform, out Triangle triangle)
 {
     if (!GetProcessedData(out var vertices, out var indices, out _))
     {
         triangle = new Triangle();
         return(false);
     }
     return(GetTriangleData(triangleID, applyWorldTransform, vertices, indices, out triangle));
 }