Unigine::Mesh Class
Interface for mesh manipulation.
To use this class, include the UnigineMesh.h file.
Related classes:
Unigine::Mesh::Vertex
Unigine::Mesh Class
Members
virtual ~Mesh ()
Virtual destructor.static Ptr< Mesh > create ()
Mesh constructor.Return value
Pointer to the created mesh.virtual int info (const char * name) const =0
Info the mesh.Arguments
- const char * name - Mesh name.
Return value
Returns 1 if the operation was a success; otherwise, 0 is returned.virtual int load (const char * name) const =0
Load the mesh.Arguments
- const char * name - Mesh name.
Return value
Returns 1 if the operation was a success; otherwise, 0 is returned.virtual int save (const char * name) const =0
Save the mesh.Arguments
- const char * name - Mesh name.
Return value
Returns 1 if the operation was a success; otherwise, 0 is returned.virtual void clear () const =0
Clear the mesh.virtual int getNumSurfaces () const =0
Return the number of object surfaces.Return value
The number of surfaces.virtual int findSurface (const char * name) const =0
Find an object surface by its name.Arguments
- const char * name - Surface name.
Return value
Surface number.virtual const char * getSurfaceName (int surface) const =0
Return the object surface name.Arguments
- int surface - Surface number.
Return value
Surface name.virtual void setSurfaceTransform (const mat4 & transform, int surface) const =0
Transform the mesh surface.Arguments
- const mat4 & transform - Transformation matrix.
- int surface - The surface number.
virtual int addMeshSurface (const char * name, Ptr< Mesh > mesh, int surface) const =0
Append a new mesh surface into the mesh.Arguments
- const char * name - New surface name.
- Ptr< Mesh > mesh - Mesh pointer.
- int surface - Mesh surface number.
virtual int addMeshSurface (int dest_surface, Ptr< Mesh > mesh, int surface) const =0
Append a mesh surface geometry into the mesh.Arguments
- int dest_surface - Destination surface number.
- Ptr< Mesh > mesh - Mesh pointer.
- int surface - Mesh surface number.
Return value
Mesh surface number.virtual int addEmptySurface (const char * name, int num_vertex, int num_indices) const =0
Append a new surface into the mesh.Arguments
- const char * name - New surface name.
- int num_vertex - Vertex number.
- int num_indices - Indices number.
Return value
Mesh surface number.virtual int addTriangleSurface (const char * name, const Vertex * vertex, int num_vertex, int cache) const =0
Append a new surface into the mesh.Arguments
- const char * name - New surface name.
- const Vertex * vertex - Vertex pointer.
- int num_vertex - Vertex number.
- int cache - Vertex cache optimization.
Return value
Mesh surface number.virtual int addTriangleSurface (const char * name, const Vertex * vertex, int num_vertex, const int * indices, int num_indices) const =0
Append a new surface into the mesh.Arguments
- const char * name - New surface name.
- const Vertex * vertex - Vertex pointer.
- int num_vertex - Vertex number.
- const int * indices - Index pointer.
- int num_indices - Index number.
Return value
Mesh surface number.virtual int getNumVertex (int surface) const =0
Return the number of mesh vertices.Arguments
- int surface - The surface number.
Return value
The number of vertices.virtual void setVertex (int num, const vec3 & xyz, int surface) const =0
Update the vertex coordinates of the given vertex.Arguments
- int num - Vertex number.
- const vec3 & xyz - Vertex coordinates.
- int surface - Surface number.
virtual vec3 getVertex (int num, int surface) const =0
Return the vertex coordinates.Arguments
- int num - Vertex number.
- int surface - Surface number.
Return value
Vertex coordinates.virtual void setNormal (int num, const vec3 & normal, int surface) const =0
Update the vertex normal of the given vertex.Arguments
- int num - Vertex number.
- const vec3 & normal - Vertex normal.
- int surface - Surface number.
virtual vec3 getNormal (int num, int surface) const =0
Return the vertex normal.Arguments
- int num - Vertex number.
- int surface - Surface number.
Return value
Vertex normal.virtual void setTangent (int num, const vec4 & tangent, int surface) const =0
Update the vertex tangent of the given vertex.Arguments
- int num - Vertex number.
- const vec4 & tangent - Vertex tangent.
- int surface - Surface number.
virtual vec4 getTangent (int num, int surface) const =0
Return the vertex tangent.Arguments
- int num - Vertex number.
- int surface - Surface number.
Return value
Vertex tangent.virtual void setTexCoord (int num, const vec4 & texcoord, int surface) const =0
Update the vertex texture coordinates of the given vertex.Arguments
- int num - Vertex number.
- const vec4 & texcoord - Vertex texture coordinates.
- int surface - Surface number.
virtual vec4 getTexCoord (int num, int surface) const =0
Return the vertex texture coordinates.Arguments
- int num - Vertex number.
- int surface - Surface number.
Return value
Vertex texture coordinates.virtual int getNumIndices (int surface) const =0
Return the number of vertex indices in the mesh.Arguments
- int surface - Surface number.
Return value
The number of indices.virtual void setIndex (int num, int index, int surface) const =0
Update an index of the given vertex in the index buffer.Arguments
- int num - Vertex number.
- int index - Index of the vertex in the vertex buffer.
- int surface - Surface number.
virtual int getIndex (int num, int surface) const =0
Return an index of the given vertex from the index buffer.Arguments
- int num - Vertex number.
- int surface - Surface number.
Return value
Index of the vertex in the vertex buffer.Last update: 03.07.2017
Помогите сделать статью лучше
Была ли эта статья полезной?
(или выберите слово/фразу и нажмите Ctrl+Enter