This page has been translated automatically.
Getting Started
Migrating to UNIGINE 2.0
C++ API Migration
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

Unigine::Mesh Class

Interface for mesh manipulation.

To use this class, include the UnigineMesh.h file.

Related classes:
Unigine::Mesh::Weight

Unigine::Mesh Class

Members


virtual ~Mesh ()

Virtual destructor.

static Ptr< Mesh > create ()

Mesh constructor.

Return value

Pointer to the created mesh.

static Ptr< Mesh > create (const char * name)

Mesh constructor.

Arguments

  • const char * name - The mesh name.

Return value

Pointer to the created mesh.

static Ptr< Mesh > create (const Ptr< Mesh > & mesh)

Mesh copy constructor.

Arguments

  • const Ptr< Mesh > & mesh - The mesh pointer.

Return value

Pointer to the created mesh.

virtual void grab () =0

Sets the owner flag to 1 for the Mesh pointer. The Mesh should not be handled by the engine after this function is called.

virtual void release () =0

Sets the owner flag to 0 for the Mesh pointer. The Mesh should be handled by the engine after this function is called.

virtual int isOwner () const =0

Returns the owner flag of the pointer. If the pointer is owner, on its deletion the object also will be deleted.

Return value

Returns the owner flag.

virtual int info (const char * name) const =0

Returns an information about the given mesh.

Arguments

  • const char * name - The mesh name.

Return value

Returns 1 if the information returned successfully; otherwise, 0.

virtual int load (const char * name) const =0

Loads the mesh with the given name for the current mesh.

Arguments

  • const char * name - The mesh name.

Return value

Returns 1 if the mesh is loaded successfully; otherwise, 0.

virtual int save (const char * name) const =0

Saves the mesh under the given name.

Arguments

  • const char * name - The mesh name.

Return value

Returns 1 if the mesh is saved successfully; otherwise, 0.

virtual void clear () const =0

Clears the mesh (including its bones, animation, surfaces and bounds).

virtual int flipYZ (int surface) const =0

Flips the Y and Z axes for the given surface: Y axis becomes equal to -Z, Z axis becomes equal to Y.

Arguments

  • int surface - The mesh surface number. The default value is -1 (all of the mesh surfaces).

Return value

Returns 1 if the axes are flipped successfully; otherwise, 0.

virtual int flipTangent (int surface) const =0

Flips the sign of the binormal component of the surface tangent space.

Arguments

  • int surface - The mesh surface number. The default value is -1 (all of the mesh surfaces).

Return value

Returns 1 if the sign of the binormal component is flipped successfully; otherwise, 0.

virtual int createBounds (int surface) const =0

Creates bounds (a bounding box and a bounding sphere) for the given surface. If the default value is used as an argument, the bounds will be created for all of the mesh surfaces.

Arguments

  • int surface - The mesh surface number. The default value is -1 (all of the mesh surfaces).

Return value

Returns 1 if bounds are created successfully; otherwise, 0.

virtual int removeIndices (int surface) const =0

Clears the coordinate and triangle indices of the given surface.

Arguments

  • int surface - The mesh surface number. The default value is -1 (all of the mesh surfaces).

Return value

Returns 1 if the indices are cleared successfully; otherwise, 0.

virtual int createIndices (int surface) const =0

Creates indices for the given surface. If the default value is used as an argument, the indices will be created for all of the mesh surfaces.

Arguments

  • int surface - The mesh surface number. The default value is -1 (all of the mesh surfaces).

Return value

Returns 1 if the indices are created successfully; otherwise, 0.

virtual int optimizeIndices (int flags, int surface) const =0

Optimizes indices of the given mesh surface. As polygons are added to a surface, vertices of the adjacent polygons are duplicated (you can get the number of such the vertices by using the getNumTVertex()), because normals, texture coordinates and tangents of such the vertices differ depending on the polygons, to which this vertices belongs. The optimizeIndices() function serves to decrease number of such the vertices and create indices for them that will be store the corresponding normals, tangents and texture coordinates.

Arguments

  • int flags - One of the flags used for indices' optimization: BACK_TO_FRONT or VERTEX_CACHE.
  • int surface - The mesh surface number. The default value is -1 (all of the mesh surfaces).

Return value

Returns 1 if the indices are optimized successfully; otherwise, 0.

virtual int createNormals (int surface, int target) const =0

Creates normals for the given surface target.

Arguments

  • int surface - The mesh surface number. The default value is -1 (all of the mesh surfaces).
  • int target - The surface target number. The default value is -1 (all of the surface targets).

Return value

Returns 1 if the normals are created successfully; otherwise, 0.

virtual int createNormals (float angle, int surface, int target) const =0

Creates normals for the surface target. If there are several normals at one vertex, a mean normal for this vertex will be calculated by using the given angle.

Arguments

  • float angle - Angle between normals used to calculate the mean vertex normal.
  • int surface - The mesh surface number. The default value is -1 (all of the mesh surfaces).
  • int target - The surface target number. The default value is -1 (all of the surface targets).

Return value

Returns 1 if the normals are created successfully; otherwise, 0.

virtual int createTangents (int surface, int target) const =0

Creates tangents for the given surface target.

Arguments

  • int surface - The mesh surface number. The default value is -1 (all of the mesh surfaces).
  • int target - The surface target number. The default value is -1 (all of the surface targets).

Return value

Returns 1 if the tangents are created successfully; otherwise, 0.

virtual int createTangents (float angle, const Vector< int > & surfaces) const =0

Creates tangents for each surface passed to the function.

Arguments

  • float angle - Angle between normals used to calculate the mean vertex normal.
  • const Vector< int > & surfaces - Array of mesh surfaces.

Return value

Returns 1 if the tangents are created successfully; otherwise, 0.

virtual int getNumBones () const =0

Returns the total number of mesh bones.

Return value

Number of the mesh bones.

virtual int findBone (const char * name) const =0

Searches for a bone with a given name and returns its number.

Arguments

  • const char * name - Name of the bone.

Return value

The bone number.

virtual int addBone (const char * name, int parent) const =0

Appends a new mesh bone.

Arguments

  • const char * name - The bone name. This argument is empty by default.
  • int parent - The parent bone number. The default value is -1 (the new bone has no parent bone).

Return value

Number of mesh bones.

virtual void setBoneName (int bone, const char * name) const =0

Sets a name for the given bone.

Arguments

  • int bone - The bone number.
  • const char * name - The bone name to be set.

virtual const char * getBoneName (int bone) const =0

Returns the name of the given bone.

Arguments

  • int bone - The bone number.

Return value

The bone name.

virtual void setBoneParent (int bone, int parent) const =0

Sets the parent bone for the given one.

Arguments

  • int bone - The bone number, for which the parent bone should be set.
  • int parent - The bone to be set as a parent.

virtual int getBoneParent (int bone) const =0

Returns the number of the parent bone of the given one.

Arguments

  • int bone - The bone number, for which the parent bone will be returned.

Return value

The parent bone number.

virtual void setBoneTransform (int bone, const mat4 & transform) const =0

Sets the transformation matrix for the given bone.

Arguments

  • int bone - The bone number.
  • const mat4 & transform - Transformation matrix to be set.

virtual mat4 getBoneTransform (int bone) const =0

Returns the transformation matrix for the given bone.

Arguments

  • int bone - The bone number.

Return value

Transformation matrix.

virtual int setBoneTransforms (const Vector< mat4 > & transforms, int animation, int frame) const =0

Updates the array of the world-space transformation matrices for bones of the given animation frame. If the passed animation number is -1, the bind pose will be updated to the given array.

Arguments

  • const Vector< mat4 > & transforms - Array of transformation matrices to be set. Its size must be equal to the number of animation bones.
  • int animation - The animation number. The default value is -1.
  • int frame - The animation frame number. The default value is 0.

Return value

Returns 1 if the array of bones' transformations is updated successfully; otherwise, 0.

virtual int getBoneTransforms (Vector< mat4 > & transforms, int animation, int frame) const =0

Appends the world-space transformation matrices for bones of the given animation frame to the given array. If the passed animation number is -1, the bind pose will be added to the given array. The number of array elements must be equal to the number of animation bones.

Arguments

  • Vector< mat4 > & transforms - Array of transformation matrices.
  • int animation - The animation number. The default value is -1.
  • int frame - The animation frame number. The default value is 0.

Return value

Returns 1 if the array of bones' transformations is filled successfully; otherwise, 0.

virtual void sortAnimations () const =0

Sorts all animations by its name.

virtual int getNumAnimations () const =0

Returns the total number of mesh animations.

Return value

Number of the mesh animations.

virtual int findAnimation (const char * name) const =0

Searches for the animation by the name and returns its number.

Arguments

  • const char * name - Name of the animation.

Return value

The animation number, if it is found; otherwise, -1.

virtual int addAnimation (const char * name) const =0

Appends an animation with a given name to the current mesh.

Arguments

  • const char * name - Name of the animation. This argument is empty by default.

Return value

Number of mesh animations.

virtual void setAnimationName (int animation, const char * name) const =0

Sets a name for the given animation.

Arguments

  • int animation - The animation number.
  • const char * name - The animation name to be set.

virtual const char * getAnimationName (int animation) const =0

Returns the name of the given animation.

Arguments

  • int animation - The animation number.

Return value

The animation name.

virtual void setAnimationBones (int animation, const Vector< int > & bones) const =0

Copies bones from the given array to the current array of animation bones.

Arguments

  • int animation - The animation number.
  • const Vector< int > & bones - Array of bones taking part in the animation to be set.

virtual void getAnimationBones (int animation, Vector< int > & bones) const =0

Adds all bones of the given animation to the given array of bones.

Arguments

  • int animation - The animation number.
  • Vector< int > & bones - Array with indices of bones taking part in the animation.

virtual void setNumAnimationFrames (int animation, int num) const =0

Sets the number of animation frames for the given animation.

Arguments

  • int animation - The animation number.
  • int num - Number of the animation frames to be set.

virtual int getNumAnimationFrames (int animation) const =0

Returns the number of animation frames for the given animation.

Arguments

  • int animation - The animation number.

Return value

Number of the animation frames.

virtual void setAnimationFrame (int animation, int num, const Vector< mat4 > & frame) const =0

Updates the animation frame coordinates, rotation quaternions and scaling vectors.

Arguments

  • int animation - The animation number.
  • int num - The frame number in the array of the animation frames.
  • const Vector< mat4 > & frame - Matrix that includes coordinates, rotation quaternions and scaling vectors of the animation frame.

virtual void getAnimationFrame (int animation, int num, Vector< mat4 > & frame) const =0

Adds the animation frame coordinates, rotation quaternions and scaling vectors to the given matrix passed to the function as the third argument. The matrix can be set by using the setAnimationFrame() function.

Arguments

  • int animation - The animation number.
  • int num - Number of the frame in the array of the animation frames.
  • Vector< mat4 > & frame - Matrix that includes coordinates, rotation quaternions and scaling vectors of the animation frame.

virtual void setAnimationFrame (int animation, int num, const Vector< vec3 > & xyz, const Vector< quat > & rot, const Vector< vec3 > & scale) const =0

Updates the animation frame coordinates, rotation quaternions and scaling vectors.

Arguments

  • int animation - The animation number.
  • int num - The frame number in the array of the animation frames.
  • const Vector< vec3 > & xyz - Array with coordinates of the animation frame.
  • const Vector< quat > & rot - Array with rotation quaternions of the animation frame.
  • const Vector< vec3 > & scale - Array with scaling vectors of the animation frame.

virtual void getAnimationFrame (int animation, int num, Vector< vec3 > & xyz, Vector< quat > & rot, Vector< vec3 > & scale) const =0

Adds the animation frame coordinates, rotation quaternions and scaling vectors to the corresponding arrays passed to the function as arguments. The arrays can be set by using the setAnimationFrame() function.

Arguments

  • int animation - The animation number.
  • int num - The frame number in the array of the animation frames.
  • Vector< vec3 > & xyz - Array with coordinates of the animation frame.
  • Vector< quat > & rot - Array with rotation quaternions of the animation frame.
  • Vector< vec3 > & scale - Array with scaling vectors of the animation frame.

virtual void sortSurfaces () const =0

Sorts all surfaces by its name.

virtual int getNumSurfaces () const =0

Returns the total number of mesh surfaces.

Return value

Number of the mesh surfaces.

virtual int findSurface (const char * name) const =0

Searches for the surface number by its name.

Arguments

  • const char * name - The mesh surface name.

Return value

The mesh surface number, if it is found; otherwise, -1.

virtual int addSurface (const char * name) const =0

Append a new surface with the given name to the current mesh.

Arguments

  • const char * name - The surface name. This argument is empty by default.

Return value

Number of mesh surfaces.

virtual void setSurfaceName (int surface, const char * name) const =0

Sets the name for the given mesh surface.

Arguments

  • int surface - The mesh surface number.
  • const char * name - The surface name to be set.

virtual const char * getSurfaceName (int surface, name) const =0

Returns the name of the given surface.

Arguments

  • int surface - The mesh surface number.
  • name - The surface name.

virtual void setNumSurfaceTargets (int surface, int num) const =0

Sets the number of targets for the given mesh surface.

Arguments

  • int surface - The mesh surface number.
  • int num - Number of the surface targets to be set.

virtual int getNumSurfaceTargets (int surface) const =0

Returns the number of targets for the given surface.

Arguments

  • int surface - The mesh surface number.

Return value

Number of targets.

virtual void setSurfaceTargetName (int surface, int target, const char * name) const =0

Sets the name for the given surface target.

Arguments

  • int surface - The mesh surface number.
  • int target - The surface target number.
  • const char * name - The surface target name to be set.

virtual const char * getSurfaceTargetName (int surface, int target) const =0

Returns the name of the given surface target.

Arguments

  • int surface - The mesh surface number.
  • int target - The surface target number.

Return value

The surface target name.

virtual int findSurfaceTarget (int surface, const char * name) const =0

Searches for the surface target number by the target name.

Arguments

  • int surface - The mesh surface number.
  • const char * name - The surface target name.

Return value

The target number, if it exists; otherwise, -1.

virtual int createIntersection (int surface) const =0

Calculates a potentially visible set for the given surface. This function prepares the mesh for working with getIntersection() function.

Arguments

  • int surface - The surface number. The default value is -1 (all of the mesh surfaces).

Return value

Returns 1 if the potentially visible set is calculated successfully; otherwise, 0.

virtual int getIntersection (const vec3 & p0, const vec3 & p1, vec3 * ret_point, vec3 * ret_normal, int * ret_index, int surface, int target) const =0

Performs the search for the intersection of the given surface target with the given traced line. Mesh local space coordinates are used for this function.

Arguments

  • const vec3 & p0 - Start point coordinates.
  • const vec3 & p1 - End point coordinates.
  • vec3 * ret_point - Return array to write the intersection point coordinates into.
  • vec3 * ret_normal - Return array to write the intersection point normal into.
  • int * ret_index - Return array to write the intersection point indices into.
  • int surface - The surface number.
  • int target - The surface target number.

Return value

Returns 1 if the intersection is found; otherwise, 0.

virtual int setSurfaceTransform (const mat4 & transform, int surface, int target) const =0

Sets the transformation matrix for the given surface target.

Arguments

  • const mat4 & transform - Transformation matrix to be set.
  • int surface - The mesh surface number. The default value is -1 (all of the mesh surfaces).
  • int target - The surface target number. The default value is -1 (all of the surface targets).

Return value

Returns 1 if the transformation matrix is set successfully; otherwise, 0.

virtual int addMeshSurface (const char * name, const Ptr< Mesh > & mesh, int surface, int target) const =0

Appends a surface of the source mesh to the current mesh.

Arguments

  • const char * name - The name of the new surface added to the current mesh.
  • const Ptr< Mesh > & mesh - Source mesh to copy a surface from.
  • int surface - The number of the source mesh surface to copy.
  • int target - The number of the target of the source mesh surface. The default value is -1 (all of the surface targets).

Return value

Returns the number of the mesh surfaces.

virtual int addMeshSurface (int dest_surface, const Ptr< Mesh > & mesh, int surface, int target) const =0

Appends geometry of the source mesh surface to the existing surface of the current mesh.

Arguments

  • int dest_surface - The number of the existing surface of the current mesh, to which the geometry is added.
  • const Ptr< Mesh > & mesh - Source mesh to copy geometry from.
  • int surface - The number of the source mesh surface to copy geometry from.
  • int target - The number of the target of the source mesh surface. The default value is -1 (all of the surface targets).

Return value

Returns the number of the surface to which the geometry has been added.

virtual int addEmptySurface (const char * name, int num_vertex, int num_indices) const =0

Appends a new empty surface to the current mesh.

Arguments

  • const char * name - The surface name.
  • int num_vertex - Number of surface vertices.
  • int num_indices - Number of surface indices.

Return value

Number of the mesh surfaces.

virtual int addSurfaceTarget (int surface, const char * name) const =0

Appends a target with the given name to the given surface.

Arguments

  • int surface - The surface number.
  • const char * name - Name of the surface target. This argument is empty by default.

Return value

Number of surface targets.

virtual int addBoxSurface (const char * name, const vec3 & size) const =0

Appends a box surface to the current mesh.

Arguments

  • const char * name - The surface name.
  • const vec3 & size - Box size along the X, Y and Z axes.

Return value

The added surface number.

virtual int addPlaneSurface (const char * name, float width, float height, float step) const =0

Appends a plane surface to the current mesh. The plane is divided into equal squares whose size is defined by the given step.

Arguments

  • const char * name - The surface name.
  • float width - The plane width.
  • float height - The plane height.
  • float step - Step of surface subdivision (vertical and horizontal).

Return value

The added surface number.

virtual int addSphereSurface (const char * name, float radius, int stacks, int slices) const =0

Appends a sphere surface to the current mesh. The stacks and slices specify the surface's subdivision.

Arguments

  • const char * name - The surface name.
  • float radius - The sphere radius.
  • int stacks - Number of stacks that divide the sphere radially.
  • int slices - Number of slices that divide the sphere horizontally.

Return value

The added surface number.

virtual int addCapsuleSurface (const char * name, float radius, float height, int stacks, int slices) const =0

Appends a capsule surface to the current mesh. The stacks and slices specify the surface's subdivision.

Arguments

  • const char * name - The surface name.
  • float radius - The capsule radius.
  • float height - The capsule height.
  • int stacks - Number of stacks that divide the capsule radially.
  • int slices - Number of slices that divide the capsule horizontally.

Return value

The added surface number.

virtual int addCylinderSurface (const char * name, float radius, float height, int stacks, int slices) const =0

Appends a cylinder surface to the current mesh. The stacks and slices specify the surface's subdivision.

Arguments

  • const char * name - The surface name.
  • float radius - The cylinder radius.
  • float height - The cylinder height.
  • int stacks - Number of stacks that divide the cylinder radially.
  • int slices - Number of slices that divide the cylinder horizontally.

Return value

The added surface number.

virtual int addPrismSurface (const char * name, float size_0, float size_1, float height, int sides) const =0

Appends a prism surface to the current mesh.

Arguments

  • const char * name - The surface name.
  • float size_0 - Radius of the circle circumscribed about the top prism base.
  • float size_1 - Radius of the circle circumscribed about the bottom prism base.
  • float height - Height of the prism.
  • int sides - Number of the prism faces.

Return value

The added surface number.

virtual int addIcosahedronSurface (const char * name, float radius) const =0

Appends a icosahedron surface to the current mesh.

Arguments

  • const char * name - The surface name.
  • float radius - The icosahedron radius.

Return value

The added surface number.

virtual int addDodecahedronSurface (const char * name, float radius) const =0

Appends a dodecahedron surface to the current mesh.

Arguments

  • const char * name - The surface name.
  • float radius - The dodecahedron radius.

Return value

The added surface number.

virtual int getNumCVertex (int surface) const =0

Returns the number of coordinate vertices of the given surface.

Arguments

  • int surface - The mesh surface number.

Return value

Number of the coordinate vertices.

virtual int getNumTVertex (int surface) const =0

Returns the number of triangle vertices for the given mesh surface.

Arguments

  • int surface - The mesh surface number.

Return value

Number of the triangle vertices.

virtual int remapCVertex (int surface) const =0

Sets the size of the array of coordinate indices to be equal to the size of the array of triangle indices and increases the size of the vertex buffer to the size of the array of triangle vertices.

Arguments

  • int surface - The mesh surface number.

Return value

Returns 1 if indices are copied successfully; otherwise, 0.

virtual void setNumVertex (int num, int surface, int target) const =0

Updates the number of vertices for the given surface target.

Arguments

  • int num - Number of the vertices to be set.
  • int surface - The mesh surface number.
  • int target - The surface target number. The default value is 0.

virtual int getNumVertex (int surface, int target) const =0

Returns the number of vertices for the given surface target.

Arguments

  • int surface - The mesh surface number.
  • int target - The surface target number. The default value is 0.

Return value

Number of the vertices.

virtual void setVertex (const vec3 * vertex, int surface, int target) const =0

Sets an array of vertices of the given surface target.

Arguments

  • const vec3 * vertex - Array of vertices.
  • int surface - The surface number.
  • int target - The surface target number. The default value is 0.

virtual vec3 * getVertex (int surface, int target) const =0

Returns an array of vertices of the given surface target.

Arguments

  • int surface - The surface number.
  • int target - The surface target number. The default value is 0.

Return value

Array of vertices.

virtual void addVertex (const vec3 & vertex, int surface, int target) const =0

Appends a new vertex with the given coordinates to the mesh surface.

Arguments

  • const vec3 & vertex - Coordinates of the vertex to be added.
  • int surface - The mesh surface number.
  • int target - The surface target number. The default value is 0.

virtual void setNumNormals (int num, int surface, int target) const =0

Sets the number of normals for the given surface target.

Arguments

  • int num - Number of normals to be set.
  • int surface - The mesh surface number.
  • int target - The surface target number. The default value is 0.

virtual int getNumNormals (int surface, int target) const =0

Returns the number of normals for the given surface target.

Arguments

  • int surface - The mesh surface number.
  • int target - The surface target number. The default value is 0.

Return value

Number of normals.

virtual void setNormals (const vec3 * vertex, int surface, int target) const =0

Sets an array of normals of the given surface target.

Arguments

  • const vec3 * vertex - Array of normals.
  • int surface - The surface number.
  • int target - The surface target number. The default value is 0.

virtual vec3 * getNormals (int surface, int target) const =0

Returns an array of normals of the given surface target.

Arguments

  • int surface - The mesh surface number.
  • int target - The surface target number. The default value is 0.

Return value

Array of normals.

virtual void addNormal (const vec3 & normal, int surface, int target) const =0

Appends a normal to the array of normals of the given surface target.

Arguments

  • const vec3 & normal - Normal to be added.
  • int surface - The surface number.
  • int target - The surface target number. The default value is 0.

virtual void setNumTangents (int num, int surface, int target) const =0

Sets the number of tangents for the given surface target.

Arguments

  • int num - Number of tangents to be set.
  • int surface - The mesh surface number.
  • int target - The surface target number. The default value is 0.

virtual int getNumTangents (int surface, int target) const =0

Returns the number of tangents for the given surface target.

Arguments

  • int surface - The mesh surface number.
  • int target - The surface target number. The default value is 0.

Return value

Number of tangents.

virtual void setTangents (const quat * vertex, int surface, int target) const =0

Sets an array of tangents of the given surface target.

Arguments

  • const quat * vertex - Array of tangents.
  • int surface - The surface number.
  • int target - The surface target number. The default value is 0.

virtual quat * getTangents (int surface, int target) const =0

Returns an array of tangents of the given surface target.

Arguments

  • int surface - The mesh surface number.
  • int target - The surface target number. The default value is 0.

Return value

Array of tangents.

virtual void addTangent (const quat & tangent, int surface, int target) const =0

Appends a new tangent to the given surface target.

Arguments

  • const quat & tangent - The tangent to be added.
  • int surface - The surface number.
  • int target - The surface target number. The default value is 0.

virtual void setNumWeights (int surface, int target) const =0

Sets the number of weights set for vertices of the given surface.

Arguments

  • int surface - Number of weights to be set.
  • int target - The mesh surface number.

virtual int getNumWeights (int surface) const =0

Returns the number of weights set for vertices of the given surface.

Arguments

  • int surface - The mesh surface number.

Return value

Number of the weights.

virtual void setWeights (const Weight * vertex, int surface, target) const =0

Sets an array of weights of the given surface target.

Arguments

  • const Weight * vertex - Array of weights.
  • int surface - The surface number.
  • target - The surface target number. The default value is 0.

virtual Weight * getWeights (int surface) const =0

Returns an array of the weights set for vertices of the given surface.

Arguments

  • int surface - The mesh surface number.

Return value

Array of weights.

virtual void addWeight (const Weight & weight, int surface) const =0

Appends a new weight to the array of the weights set for vertices of the given surface.

Arguments

  • const Weight & weight - New weight to be added.
  • int surface - The surface number.

virtual void setNumTexCoords0 (int num, int surface) const =0

Sets the number of the first UV map texture coordinates for the given mesh surface.

Arguments

  • int num - Number of the first UV map texture coordinates to be set.
  • int surface - The mesh surface number.

virtual int getNumTexCoords0 (int surface) const =0

Returns the number of the first UV map texture coordinates for the given mesh surface.

Arguments

  • int surface - The mesh surface number.

Return value

Number of the first UV map texture coordinates.

virtual void setTexCoords0 (const vec2 * vertex, int surface, target) const =0

Sets an array of texcoords of the given surface target.

Arguments

  • const vec2 * vertex - Array of texcoords.
  • int surface - The surface number.
  • target - The surface target number. The default value is 0.

virtual vec2 * getTexCoords0 (int surface) const =0

Returns an array of the first UV map coordinates of the given mesh surface.

Arguments

  • int surface - The mesh surface number.

Return value

Array of texture coordinates.

virtual void addTexCoord0 (const vec2 & texcoord, int surface) const =0

Appends texture coordinates to the array of the first UV map coordinates of the given mesh surface.

Arguments

  • const vec2 & texcoord - Coordinates of the first UV map to be added.
  • int surface - The surface number.

virtual void setNumTexCoords1 (int num, int surface) const =0

Sets the number of the second UV map texture coordinates for the given mesh surface.

Arguments

  • int num - Number of the second UV map texture coordinates to be set.
  • int surface - The mesh surface number.

virtual int getNumTexCoords1 (int surface) const =0

Returns the number of the second UV map texture coordinates for the given mesh surface.

Arguments

  • int surface - The mesh surface number.

Return value

Number of the second UV map texture coordinates.

virtual void setTexCoords1 (const vec2 * vertex, int surface, target) const =0

Sets an array of texcoords of the given surface target.

Arguments

  • const vec2 * vertex - Array of texcoords.
  • int surface - The surface number.
  • target - The surface target number. The default value is 0.

virtual vec2 * getTexCoords1 (int surface) const =0

Returns an array of the second UV map coordinates of the given mesh surface.

Arguments

  • int surface - The mesh surface number.

Return value

Array of texture coordinates.

virtual void addTexCoord1 (const vec2 & texcoord, int surface) const =0

Appends texture coordinates to the array of the second UV map coordinates of the given mesh surface.

Arguments

  • const vec2 & texcoord - Coordinates of the second UV map to be added.
  • int surface - The surface number.

virtual void setNumColors (int num, int surface) const =0

Sets the number of colors set for vertices of the given surface.

Arguments

  • int num - Number of colors to be set.
  • int surface - The mesh surface number.

virtual int getNumColors (int surface) const =0

Returns the number of colors set for vertices of the given surface.

Arguments

  • int surface - The mesh surface number.

Return value

Number of colors.

virtual void setColors (const bvec4 * vertex, int surface, target) const =0

Sets an array of colors of the given surface target.

Arguments

  • const bvec4 * vertex - Array of colors.
  • int surface - The surface number.
  • target - The surface target number. The default value is 0.

virtual bvec4 * getColors (int surface) const =0

Returns an array of colors set for vertices of the given surface.

Arguments

  • int surface - The mesh surface number.

Return value

Array of colors.

virtual void addColor (const bvec4 & color, int surface) const =0

Appends the given color to the vertex color array of the given surface.

Arguments

  • const bvec4 & color - Color to be added.
  • int surface - The surface number.

virtual void setNumCIndices (int num, int surface) const =0

Sets the number of coordinate indices for the given surface.

Arguments

  • int num - Number of the coordinate indices to be set.
  • int surface - The mesh surface number.

virtual int getNumCIndices (int surface) const =0

Returns the number of coordinate indices for the given surface.

Arguments

  • int surface - The mesh surface number.

Return value

Number of the coordinate indices.

virtual void setCIndices (const int * vertex, int surface, target) const =0

Sets an array of coordinate indices of the given surface target.

Arguments

  • const int * vertex - Array of coordinate indices.
  • int surface - The surface number.
  • target - The surface target number. The default value is 0.

virtual int * getCIndices (int surface) const =0

Returns an array with coordinate indices for the given surface.

Arguments

  • int surface - The mesh surface number.

Return value

Array of coordinate indices.

virtual void addCIndex (int index, int surface) const =0

Appends a coordinate index to the array of the surface coordinate indices.

Arguments

  • int index - The index number in the index buffer.
  • int surface - The surface number.

virtual void setNumTIndices (int num, int surface) const =0

Sets the number of triangle indices for the given surface.

Arguments

  • int num - Number of triangle indices to be set.
  • int surface - Number of the mesh surface.

virtual int getNumTIndices (int surface) const =0

Returns the number of triangle indices for the given surface.

Arguments

  • int surface - The mesh surface number.

Return value

Number of the triangle indices.

virtual void setTIndices (const int * vertex, int surface, target) const =0

Sets an array of triangle indices of the given surface target.

Arguments

  • const int * vertex - Array of triangle indices.
  • int surface - The surface number.
  • target - The surface target number. The default value is 0.

virtual int * getTIndices (int surface) const =0

Returns an array with triangle indices for the given surface.

Arguments

  • int surface - The mesh surface number.

Return value

Array of triangle indices.

virtual void addTIndex (int index, int surface) const =0

Appends a triangle index to the given mesh surface.

Arguments

  • int index - The index number in the index buffer.
  • int surface - The number of the surface to which the triangle index is added.

virtual void setBoundBox (const BoundBox & bb, int surface) const =0

Sets the bounding box for the given mesh surface.

Arguments

  • const BoundBox & bb - Bounding box to be set.
  • int surface - The mesh surface number.

virtual void setBoundSphere (const BoundSphere & bs, int surface) const =0

Sets the bounding sphere for the given mesh surface.

Arguments

  • const BoundSphere & bs - Bounding sphere to be set.
  • int surface - The mesh surface number.

virtual BoundBox getBoundBox (int surface) const =0

Returns the bounding box of a given surface.

Arguments

  • int surface - The surface number.

Return value

Bounding box.

virtual BoundSphere getBoundSphere (int surface) const =0

Returns the bounding sphere of a given surface.

Arguments

  • int surface - The surface number.

Return value

Bounding sphere.

virtual void setBoundBox (const BoundBox & bb) const =0

Sets the bounding box for the current mesh.

Arguments

  • const BoundBox & bb - Bounding box to be set.

virtual void setBoundSphere (const BoundSphere & bs) const =0

Sets the bounding sphere for the current mesh.

Arguments

  • const BoundSphere & bs - Bounding sphere to be set.

virtual BoundBox getBoundBox () const =0

Returns the bounding box of the current mesh.

Return value

Bounding box.

virtual BoundSphere getBoundSphere () const =0

Returns the bounding sphere of the current mesh.

Return value

Bounding sphere.

Unigine::Mesh::anonymous_80 Enumeration

VERTEX_CACHE = 1 << 0
BACK_TO_FRONT = 1 << 1
NUM_WEIGHTS = 4
Last update: 03.07.2017
Build: ()