SceneMesh Class

This type is an EasyAR Sense API in C#: SceneMesh . Some descriptions may not apply to Unity environment on this page.

Some parts of the Sense API may have already been wrapped into Unity components, and directly usages may not be necessary.

Description

SceneMesh is used to manage and preserve the results of DenseSpatialMap .

There are two kinds of meshes saved in SceneMesh, one is the mesh of the whole reconstructed scene, hereinafter referred to as meshAll, the other is the recently updated mesh, hereinafter referred to as meshUpdated. meshAll is a whole mesh, including all vertex data and index data, etc. meshUpdated is composed of several mesh block s, each mesh block is a cube, which contains the mesh formed by the object surface in the corresponding cube space.

meshAll is available only when the DenseSpatialMap.updateSceneMesh method is called specifying that all meshes need to be updated. If meshAll has been updated previously and not updated in recent times, the data in meshAll is remain the same.


Methods

getNumOfVertexAll

C#

public virtual int getNumOfVertexAll()

Get the number of vertices in meshAll.

getNumOfIndexAll

C#

public virtual int getNumOfIndexAll()

Get the number of indices in meshAll. Since every 3 indices form a triangle, the returned value should be a multiple of 3.

getVerticesAll

C#

public virtual Buffer getVerticesAll()

Get the position component of the vertices in meshAll (in the world coordinate system). The position of a vertex is described by three coordinates (x, y, z) in meters. The position data are stored tightly in Buffer by x1, y1, z1, x2, y2, z2, … Each component is of float type.

getNormalsAll

C#

public virtual Buffer getNormalsAll()

Get the normal component of vertices in meshAll. The normal of a vertex is described by three components (nx, ny, nz). The normal is normalized, that is, the length is 1. Normal data are stored tightly in Buffer by nx1, ny1, nz1, nx2, ny2, nz2,…. Each component is of float type.

getIndicesAll

C#

public virtual Buffer getIndicesAll()

Get the index data in meshAll. Each triangle is composed of three indices (ix, iy, iz). Indices are stored tightly in Buffer by ix1, iy1, iz1, ix2, iy2, iz2,… Each component is of int32 type.

getNumOfVertexIncremental

C#

public virtual int getNumOfVertexIncremental()

Get the number of vertices in meshUpdated.

getNumOfIndexIncremental

C#

public virtual int getNumOfIndexIncremental()

Get the number of indices in meshUpdated. Since every 3 indices form a triangle, the returned value should be a multiple of 3.

getVerticesIncremental

C#

public virtual Buffer getVerticesIncremental()

Get the position component of the vertices in meshUpdated (in the world coordinate system). The position of a vertex is described by three coordinates (x, y, z) in meters. The position data are stored tightly in Buffer by x1, y1, z1, x2, y2, z2, … Each component is of float type.

getNormalsIncremental

C#

public virtual Buffer getNormalsIncremental()

Get the normal component of vertices in meshUpdated. The normal of a vertex is described by three components (nx, ny, nz). The normal is normalized, that is, the length is 1. Normal data are stored tightly in Buffer by nx1, ny1, nz1, nx2, ny2, nz2,…. Each component is of float type.

getIndicesIncremental

C#

public virtual Buffer getIndicesIncremental()

Get the index data in meshUpdated. Each triangle is composed of three indices (ix, iy, iz). Indices are stored tightly in Buffer by ix1, iy1, iz1, ix2, iy2, iz2,… Each component is of int32 type.

getBlocksInfoIncremental

C#

public virtual List< BlockInfo > getBlocksInfoIncremental()

Gets the description object of mesh block in meshUpdate. The return value is an array of BlockInfo elements, each of which is a detailed description of a mesh block.

getBlockDimensionInMeters

C#

public virtual float getBlockDimensionInMeters()

Get the edge length of a mesh block in meters.