Mesh Class Reference

Class representing a mesh and containing the geometric (and optionally texture) data of the scene captured by the spatial mapping module. More...

Attributes

int[] nbVerticesInSubmesh = new int[(int)Constant.MAX_SUBMESH]
 Number of vertices per chunk/sub-mesh. More...
 
int[] nbTrianglesInSubmesh = new int[(int)Constant.MAX_SUBMESH]
 Number of triangles per chunk/sub-mesh. More...
 
int[] updatedIndices = new int[(int)Constant.MAX_SUBMESH]
 Number of indices per chunk/sub-mesh. More...
 
int nbVertices = 0
 Vertices count in current sub-mesh. More...
 
int nbTriangles = 0
 Triangle count in current sub-mesh. More...
 
int nbUpdatedSubmesh = 0
 Number of updated sub-meshes. More...
 
Vector3[] vertices = new Vector3[(int)Constant.MAX_SUBMESH]
 Vector of vertices. More...
 
int[] triangles = new int[(int)Constant.MAX_SUBMESH]
 Vector of of triangles/faces. More...
 
byte[] colors = new byte[(int)Constant.MAX_SUBMESH]
 Vector of colors. More...
 
Vector2[] uvs = null
 UVs defines the 2D projection of each vertices onto the texture. More...
 
IntPtr textures = IntPtr.Zero
 Texture of the sl.Mesh. More...
 
int[] texturesSize = new int[2]
 Width and height of the sl.Mesh texture, if any. More...
 
Dictionary< int, Chunkchunks = new Dictionary<int, Chunk>((int)Constant.MAX_SUBMESH)
 Dictionary of all existing chunks. More...
 

Detailed Description

Class representing a mesh and containing the geometric (and optionally texture) data of the scene captured by the spatial mapping module.

By default the mesh is defined as a set of chunks.
This way we update only the data that has to be updated avoiding a time consuming remapping process every time a small part of the sl.Mesh is updated.

Variables

◆ nbVerticesInSubmesh

int [] nbVerticesInSubmesh = new int[(int)Constant.MAX_SUBMESH]

Number of vertices per chunk/sub-mesh.

◆ nbTrianglesInSubmesh

int [] nbTrianglesInSubmesh = new int[(int)Constant.MAX_SUBMESH]

Number of triangles per chunk/sub-mesh.

◆ updatedIndices

int [] updatedIndices = new int[(int)Constant.MAX_SUBMESH]

Number of indices per chunk/sub-mesh.

◆ nbVertices

int nbVertices = 0

Vertices count in current sub-mesh.

◆ nbTriangles

int nbTriangles = 0

Triangle count in current sub-mesh.

Every three values of triangles are the indexes of the three vertices constituting a triangular face.

◆ nbUpdatedSubmesh

int nbUpdatedSubmesh = 0

Number of updated sub-meshes.

◆ vertices

Vector3 [] vertices = new Vector3[(int)Constant.MAX_SUBMESH]

Vector of vertices.

◆ triangles

int [] triangles = new int[(int)Constant.MAX_SUBMESH]

Vector of of triangles/faces.

Triangles are defined as a set of three vertices indexes {v1, v2, v3}.

◆ colors

byte [] colors = new byte[(int)Constant.MAX_SUBMESH]

Vector of colors.

◆ uvs

Vector2 [] uvs = null

UVs defines the 2D projection of each vertices onto the texture.

Values are normalized [0, 1] and start from the bottom left corner of the texture (as requested by OpenGL). In order to display a textured mesh you need to bind the texture and then draw each triangle by picking its uv values.

◆ textures

IntPtr textures = IntPtr.Zero

Texture of the sl.Mesh.

◆ texturesSize

int [] texturesSize = new int[2]

Width and height of the sl.Mesh texture, if any.

◆ chunks

Dictionary<int, Chunk> chunks = new Dictionary<int, Chunk>((int)Constant.MAX_SUBMESH)

Dictionary of all existing chunks.