Skip to content
Noah Gallo edited this page Mar 12, 2023 · 2 revisions

Mesh

A mesh is a collection of triangles in 3D spave that when put together can create a representation of a 3D object. For more info on meshes, please visit the project sites fundamentals page.

Public Constructors (Non-Default)

Signature Description
Mesh(int verticesLength, vec3 vertices[], int trianglesLength, int triangles[]) Creates a new mesh with the given mesh data

Public Fields/Properties

Name Property? Type Description
Vertices YES vec3[] Stores the mesh vertices (a collection of 3D points)
Triangles YES int[] a collection of vertex indices that make up the mesh triangles
UV0 YES vec2 The UVs (texture coords) associate with each vertex (must be the same length as the vertices array)

Public Methods

Signature Return Type Description
SetVertexBufferMode(GLenum drawMode) void Set's the OpenGL buffer drawing mode
Use() void Tells OpenGL to use this mesh in the next draw call
UnUse() void Tells OpenGL to stop using this mesh
IsInUse() bool Returns true if this mesh is actively in use
SetUsing() void Tells the mesh that an object is currently using it
SetNotUsing() void Tells the mesh that no one is currently using it

Clone this wiki locally