X-Git-Url: http://nitlanguage.org diff --git a/lib/gamnit/depth/depth_core.nit b/lib/gamnit/depth/depth_core.nit index 588b321..e7e42de 100644 --- a/lib/gamnit/depth/depth_core.nit +++ b/lib/gamnit/depth/depth_core.nit @@ -84,7 +84,7 @@ end # 3D model composed of `Mesh` and `Material`, loaded from the assets folder by default # -# Instances can be created at any time and must be loaded after or at the end of `on_create`. +# Instances can be created at any time and must be loaded after or at the end of `create_scene`. # If loading fails, the model is replaced by `placeholder_model`. # # ~~~ @@ -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`