Commits

Karsten Schmidt committed 0a05a25

adding TriangleMesh.getNormalsForUniqueVerticesAsArray()

  • Participants
  • Parent commits a2e8b09
  • Branches toxiclibs

Comments (0)

Files changed (1)

src.core/toxi/geom/mesh/TriangleMesh.java

         return verts;
     }
 
+    public float[] getNormalsForUniqueVerticesAsArray() {
+        float[] normals = new float[numVertices * 3];
+        int i = 0;
+        for (Vertex v : vertices.values()) {
+            normals[i++] = v.normal.x;
+            normals[i++] = v.normal.y;
+            normals[i++] = v.normal.z;
+        }
+        return normals;
+    }
+
     public int getNumFaces() {
         return numFaces;
     }