Exemplo n.º 1
0
 public static void TransformMesh(TS_Mesh input, TS_Transform transform)
 {
     if (input.vertices != null && input.normals != null)
     {
         for (int i = 0; i < input.vertices.Length; i++)
         {
             input.vertices[i] = transform.TransformPoint(input.vertices[i]);
             input.normals[i]  = transform.TransformDirection(input.normals[i]);
         }
     }
 }
Exemplo n.º 2
0
 public static void InverseTransformMesh(TS_Mesh input, TS_Transform transform)
 {
     if (input.vertices == null || input.normals == null)
     {
         return;
     }
     for (int i = 0; i < input.vertices.Length; i++)
     {
         input.vertices[i] = transform.InverseTransformPoint(input.vertices[i]);
         input.normals[i]  = transform.InverseTransformDirection(input.normals[i]);
     }
 }