Regular API function

simGetShapeMesh / sim.getShapeMesh

Description Retrieves a shape's mesh information. See also sim.getShapeViz, sim.createMeshShape and sim.exportMesh for a usage example.
C synopsis simInt simGetShapeMesh(simInt shapeHandle,simFloat** vertices,simInt* verticesSize,simInt** indices,simInt* indicesSize,simFloat** normals)
C parameters
shapeHandle: handle of the shape
vertices: receives the vertices. The user is in charge of destroying the array with simReleaseBuffer. See simExportMesh for a usage example.
verticesSize: receives the size of the vertices array. See simExportMesh for a usage example.
indices: receives the indices. The user is in charge of destroying the array with simReleaseBuffer. See simExportMesh for a usage example.
indicesSize: receives the size of the indice array. See simExportMesh for a usage example.
normals: receives the normals (3 times the size of indicesSize). The user is in charge of destroying the array with simReleaseBuffer. Can be nullptr.
C return value
-1 if operation was not successful
Lua synopsis table[] vertices,table[] indices,table[] normals=sim.getShapeMesh(int shapeHandle)
Lua parameters
shapeHandle: handle of the shape. See sim.exportMesh for a usage example.
Lua return values
vertices: table of vertices
indices: table of indices
normals: table of normals