gamnit: tweak doc of Mesh
authorAlexis Laferrière <alexis.laf@xymus.net>
Fri, 6 Oct 2017 23:24:45 +0000 (19:24 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Tue, 21 Nov 2017 19:40:26 +0000 (14:40 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/gamnit/depth/depth_core.nit

index 588b321..cc194f7 100644 (file)
@@ -185,7 +185,10 @@ end
 # ~~~
 class Mesh
 
-       # Vertices coordinates
+       # Number for vertices
+       fun n_vertices: Int do return vertices.length / 3
+
+       # Vertices relative coordinates, 3 floats per vertex
        var vertices = new Array[Float] is lazy, writable
 
        # Indices to draw triangles with `glDrawElements`
@@ -195,10 +198,10 @@ class Mesh
 
        private var indices_c = new CUInt16Array.from(indices) is lazy, writable
 
-       # Normals on each vertex
+       # Normals, 3 floats per vertex
        var normals = new Array[Float] is lazy, writable
 
-       # Coordinates on the texture per vertex
+       # Coordinates on the texture, 2 floats per vertex
        var texture_coords = new Array[Float] is lazy, writable
 
        # `GLDrawMode` used to display this mesh, defaults to `gl_TRIANGLES`