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
Migration
Migrating to UNIGINE 2.0
C++ API Migration
Migrating from UNIGINE 2.0 to UNIGINE 2.1

Unigine::Mesh Class

UNIGINEUNIGINE 2.0Comments
-static Ptr< Mesh > create (const char * name) Mesh constructor.
-static Ptr< Mesh > create (const Ptr< Mesh > & mesh) Mesh copy constructor.
-virtual void grab () =0 Sets the owner flag to 1 for the Mesh pointer.
-virtual void release () =0 Sets the owner flag to 0 for the Mesh pointer.
-virtual int isOwner () const =0 Returns the owner flag of the pointer.
- Flips the Y and Z axes for the given surface.
-virtual int flipTangent (int surface) const =0 Flips the sign of the binormal component of the surface tangent space.
-virtual int createBounds (int surface) const =0 Creates bounds (a bounding box and a bounding sphere) for the given surface.
-virtual int removeIndices (int surface) const =0 Clears the coordinate and triangle indices of the given surface.
-virtual int createIndices (int surface) const =0 Creates indices for the given surface.
-virtual int optimizeIndices (int flags, int surface) const =0 Optimizes indices of the given mesh surface.
-virtual int createNormals (int surface, int target) const =0 Creates normals for the given surface target.
-virtual int createNormals (int surface, int target) const =0 Creates normals for the given surface target.
-virtual int createTangents (float angle, const Vector< int > & surfaces) const =0 Creates normals for the surface target.
-virtual int createTangents (int surface, int target) const =0 Creates tangents for each surface passed to the function.
-virtual int findBone (const char * name) const =0 Searches for a bone with a given name and returns its number.
-virtual int addBone (const char * name, int parent) const =0 Appends a new mesh bone.
-virtual void setBoneName (int bone, const char * name) const =0 Sets a name for the given bone.
-virtual const char * getBoneName (int bone) const =0 Returns the name of the given bone.
-virtual void setBoneParent (int bone, int parent) const =0 Sets the parent bone for the given one.
-virtual int getBoneParent (int bone) const =0 Returns the number of the parent bone of the given one.
-virtual void setBoneTransform (int bone, const mat4 & transform) const =0 Sets the transformation matrix for the given bone.
-virtual mat4 getBoneTransform (int bone) const =0 Returns the transformation matrix for the given bone.
-virtual int getNumAnimations () const =0 Returns the total number of mesh animations.
-virtual int findAnimation (const char * name) const =0 Searches for the animation by the name and returns its number.
-virtual int addAnimation (const char * name) const =0 Appends an animation with a given name to the current mesh.
-virtual void setAnimationName (int animation, const char * name) const =0 Sets a name for the given animation.
-virtual const char * getAnimationName (int animation) const =0 Returns the name of the given animation.
-virtual void setAnimationBones (int animation, const Vector< int > & bones) const =0 Copies bones from the given array to the current array of animation bones.
-virtual void getAnimationBones (int animation, Vector< int > & bones) const =0 Adds all bones of the given animation to the given array of bones.
-virtual void setNumAnimationFrames (int animation, int num) const =0 Sets the number of animation frames for the given animation.
-virtual int getNumAnimationFrames (int animation) const =0 Returns the number of animation frames for the given animation.
-virtual void setAnimationFrame (int animation, int num, const Vector< mat4 > & frame) const =0 Updates the animation frame coordinates, rotation quaternions and scaling vectors.
-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.
-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.
-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.
-virtual int addSurface (const char * name) const =0 Appends a new surface with the given name to the current mesh.
-virtual void setSurfaceName (int surface, const char * name) const =0 Sets the name for the given mesh surface.
-virtual void setNumSurfaceTargets (int surface, int num) const =0 Sets the number of targets for the given mesh surface.
-virtual int getNumSurfaceTargets (int surface) const =0 Returns the number of targets for the given surface.
-virtual void setSurfaceTargetName (int surface, int target, const char * name) const =0 Sets the name for the given surface target.
-virtual const char * getSurfaceTargetName (int surface, int target) const =0 Returns the name of the given surface target.
-virtual int findSurfaceTarget (int surface, const char * name) const =0 Searches for the surface target number by the target name.
-virtual int createIntersection (int surface) const =0 Calculates a potentially visible set for the given surface.
-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.
-virtual int setSurfaceTransform (const mat4 & transform, int surface, int target) const =0 Sets the transformation matrix for the given surface target.
-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.
-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.
-virtual int addSurfaceTarget (int surface, const char * name) const =0 Appends a target with the given name to the given surface.
-virtual int addBoxSurface (const char * name, const vec3 & size) const =0 Appends a box surface to the current mesh.
-virtual int addPlaneSurface (const char * name, float width, float height, float step) const =0 Appends a plane surface to the current mesh.
-virtual int addSphereSurface (const char * name, float radius, int stacks, int slices) const =0 Appends a sphere surface to the current mesh.
-virtual int addCapsuleSurface (const char * name, float radius, float height, int stacks, int slices) const =0 Appends a capsule surface to the current mesh.
-virtual int addCylinderSurface (const char * name, float radius, float height, int stacks, int slices) const =0 Appends a cylinder surface to the current mesh.
-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.
-virtual int addIcosahedronSurface (const char * name, float radius) const =0
- Appends a icosahedron surface to the current mesh.
-virtual int getNumCVertex (int surface) const =0 Returns the number of coordinate vertices of the given surface.
-virtual int getNumTVertex (int surface) const =0 Returns the number of triangle vertices for the given mesh surface.
-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.
-virtual void setNumVertex (int num, int surface, int target) const =0 Updates the number of vertices for the given surface target.
-virtual int getNumVertex (int surface, int target) const =0 Returns the number of vertices for the given surface target.
-virtual void setVertex (const vec3 * vertex, int surface, int target) const =0 Sets an array of vertices of the given surface target.
-virtual void addVertex (const vec3 & vertex, int surface, int target) const =0 Appends a new vertex with the given coordinates to the mesh surface.
-virtual void setNumNormals (int num, int surface, int target) const =0 Sets the number of normals for the given surface target.
-virtual int getNumNormals (int surface, int target) const =0 Returns the number of normals for the given surface target.
-virtual vec3 * getNormals (int surface, int target) const =0 Returns an array of normals of the given surface target.
-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.
-virtual void setNumTangents (int num, int surface, int target) const =0 Sets the number of tangents for the given surface target.
-virtual int getNumTangents (int surface, int target) const =0 Returns the number of tangents for the given surface target.
-virtual quat * getTangents (int surface, int target) const =0 Returns an array of tangents of the given surface target.
-virtual void addTangent (const quat & tangent, int surface, int target) const =0 Appends a new tangent to the given surface target.
-virtual void setNumWeights (int surface, int target) const =0 Sets the number of weights set for vertices of the given surface.
-virtual int getNumWeights (int surface) const =0 Returns the number of weights set for vertices of the given surface.
-virtual Weight * getWeights (int surface) const =0 Returns an array of the weights set for vertices of the given surface.
-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.
-virtual void setNumTexCoords0 (int num, int surface) const =0 Sets the number of the first UV map texture coordinates for the given mesh surface.
-virtual int getNumTexCoords0 (int surface) const =0 Returns the number of the first UV map texture coordinates for the given mesh surface.
-virtual void addTexCoord0 (const vec2 & texcoord, int surface) const =0 ppends texture coordinates to the array of the first UV map coordinates of the given mesh surface.
-virtual void setNumTexCoords1 (int num, int surface) const =0 Sets the number of the second UV map texture coordinates for the given mesh surface.
-virtual int getNumTexCoords1 (int surface) const =0 Returns the number of the second UV map texture coordinates for the given mesh surface.
-virtual void setTexCoords1 (const vec2 * vertex, int surface, target) const =0 Sets an array of texcoords of the given surface target.
-virtual vec2 * getTexCoords1 (int surface) const =0 Returns an array of the second UV map coordinates of the given mesh surface.
-virtual void setNumColors (int num, int surface) const =0 Sets the number of colors set for vertices of the given surface.
-virtual int getNumColors (int surface) const =0 Returns the number of colors set for vertices of the given surface.
-virtual bvec4 * getColors (int surface) const =0 Returns an array of colors set for vertices of the given surface.
-virtual void addColor (const bvec4 & color, int surface) const =0 Appends the given color to the vertex color array of the given surface.
-virtual void setNumCIndices (int num, int surface) const =0 Sets the number of coordinate indices for the given surface.
-virtual int getNumCIndices (int surface) const =0 Returns the number of coordinate indices for the given surface.
-virtual int * getCIndices (int surface) const =0 Returns an array with coordinate indices for the given surface.
-virtual void addCIndex (int index, int surface) const =0 Appends a coordinate index to the array of the surface coordinate indices.
-virtual void setNumTIndices (int num, int surface) const =0 Sets the number of triangle indices for the given surface.
-virtual int getNumTIndices (int surface) const =0 Returns the number of triangle indices for the given surface.
-virtual void setTIndices (const int * vertex, int surface, target) const =0 Sets an array of triangle indices of the given surface target.
-virtual int * getTIndices (int surface) const =0 Returns an array with triangle indices for the given surface.
-virtual void addTIndex (int index, int surface) const =0 Appends a triangle index to the given mesh surface.
-virtual void setBoundBox (const BoundBox & bb, int surface) const =0 Sets the bounding box for the given mesh surface.
-virtual void setBoundSphere (const BoundSphere & bs, int surface) const =0 Sets the bounding sphere for the given mesh surface.
-virtual BoundBox getBoundBox (int surface) const =0 Returns the bounding box of a given surface.
-virtual BoundSphere getBoundSphere (int surface) const =0 Returns the bounding sphere of a given surface.
-virtual void setBoundBox (const BoundBox & bb) const =0 Sets the bounding box for the current mesh.
-virtual void setBoundSphere (const BoundSphere & bs) const =0 Sets the bounding sphere for the current mesh.
-virtual BoundBox getBoundBox () const =0 Returns the bounding box of the current mesh.
-virtual BoundSphere getBoundSphere () const =0 Returns the bounding sphere of the current mesh.
virtual void setIndex (int num, int index, int surface) const =0- Removed.
virtual int getNumIndices (int surface) const =0- Removed.
virtual vec4 getTexCoord (int num, int surface) const =0- Removed.
virtual void setTexCoord (int num, const vec4 & texcoord, int- Removed.
virtual vec4 getTangent (int num, int surface) const =0- Removed.
virtual void setTangent (int num, const vec4 & tangent, int surface) const =0- Removed.
virtual vec3 getNormal (int num, int surface) const =0- Removed.
virtual void setNormal (int num, const vec3 & normal, int surface) const =0- Removed.
virtual vec3 getVertex (int num, int surface) const =0virtual vec3 * getVertex (int surface, int target) const =0 Added the target argument.
virtual void setVertex (int num, const vec3 & xyz, int surface) const =0- Removed.
virtual int getNumVertex (int surface) const =0- Removed.
virtual int addTriangleSurface (const char * name, const Vertex * vertex, int num_vertex, const int * indices, int num_indices) const =0- Removed.
virtual int addTriangleSurface (const char * name, const Vertex * vertex, int num_vertex, int cache) const =0- Removed.
virtual int addEmptySurface (const char * name, int num_vertex, int num_indices) const =0- Removed.
virtual int addMeshSurface (int dest_surface, Ptr< Mesh > mesh, int surface) const =0- Removed.
virtual int addMeshSurface (const char * name, Ptr< Mesh > mesh, int surface) const =0- Removed.
virtual void setSurfaceTransform (const mat4 & transform, int surface) const =0- Removed.
virtual const char * getSurfaceName (int surface) const =0virtual const char * getSurfaceName (int surface, name) const =0 Changed the argument type.
virtual int findSurface (const char * name) const =0virtual int findSurface (const char * name) const =0 Changed the argument type.
Last update: 2017-07-03