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::ObjectMeshStatic Class

Interface for object mesh static handling. See also the UnigineScript analog.

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

Unigine::ObjectMeshStatic Class

Members


static int type ()

ObjectMeshStatic type.

Return value

ObjectMeshStatic type identifier.

static Ptr< ObjectMeshStatic > create (const NodePtr & node)

ObjectMeshStatic constructor.

Arguments

  • const NodePtr & node - Node smart pointer.

static Ptr< ObjectMeshStatic > create (const ObjectPtr & object)

ObjectMeshStatic constructor.

Arguments

  • const ObjectPtr & object - Object smart pointer.

static Ptr< ObjectMeshStatic > create (const MeshPtr & mesh)

ObjectMeshStatic constructor. Creates a new mesh object from a given file.

Arguments

  • const MeshPtr & mesh - Mesh smart pointer.

static Ptr< ObjectMeshStatic > create (const char * name, int dynamic)

ObjectMeshStatic constructor. Creates a new mesh object from a given file.

Arguments

  • const char * name - Path to the mesh file.
  • int dynamic - Create dynamic mesh.

virtual int createMesh (const char * name, int dynamic) const =0

Creates a mesh.

Arguments

  • const char * name - Path to the mesh file.
  • int dynamic - Create dynamic mesh.

Return value

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

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

Loads a mesh file.

Arguments

  • const char * name - Mesh file name.

Return value

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

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

Saves the mesh into a file.

Arguments

  • const char * name - Mesh file name.

Return value

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

virtual int setMesh () const =0

Sets a mesh.

virtual int getMesh () const =0

Returns a mesh.

virtual void flushMesh () const =0

Flushes the mesh geometry into the video memory.

virtual void setMeshName () const =0

Sets the new mesh name.

virtual const char * getMeshName () const =0

Returns the new mesh name.

virtual void updateSurfaceBounds (int surface) const =0

Updates mesh bounds.

Arguments

  • int surface - Surface number (use -1 for all surfaces).

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

Transforms the mesh surface.

Arguments

  • const mat4 & transform - Transformation matrix.
  • int surface - Surface number.
  • int target - Target number.

virtual int addMeshSurface (const char * name, const MeshPtr & mesh, int surface, int target) const =0

Appends a new mesh surface to the current mesh.

Arguments

  • const char * name - Name of the new surface of the current mesh.
  • const MeshPtr & mesh - Mesh pointer to copy a surface from.
  • int surface - Mesh surface number to copy.
  • int target - Mesh target number to copy.

Return value

Number of the added mesh surface.

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

Appends a new mesh surface to the current mesh.

Arguments

  • const char * name - Name of the new surface of the current mesh.
  • const Ptr< ObjectMeshStatic > & mesh - Mesh pointer to copy a surface from.
  • int surface - Mesh surface number to copy.
  • int target - Mesh target number to copy.

Return value

Number of the added mesh surface.

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

Appends a new mesh surface to the current mesh.

Arguments

  • int dest_surface - Destination surface number.
  • const Ptr< ObjectMeshStatic > & mesh - Mesh pointer to copy a surface from.
  • int surface - Mesh surface number to copy.
  • int target - Mesh target number to copy.

Return value

Number of the added mesh surface.

virtual int getMeshSurface (const MeshPtr & mesh, int surface, int target) const =0

Gets the mesh surface from the current mesh

Arguments

  • const MeshPtr & mesh - Mesh pointer to copy a surface into.
  • int surface - Mesh surface number to copy.
  • int target - Mesh target number to copy.

Return value

Number of the added mesh surface.

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

Appends a new surface into the mesh.

Arguments

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

Return value

Appended surface number.

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

Appends a surface target into the mesh.

Arguments

  • int surface - Surface number.
  • const char * name - New target name.

Return value

Appended target number.

virtual int getNumVertex (int surface) const =0

Returns the number of vertices in a given mesh surface.

Arguments

  • int surface - Surface number.

Return value

Number of the surface vertices.

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

Updates coordinate of a given vertex.

Arguments

  • int num - Vertex number.
  • const vec3 & vertex - Vertex coordinate.
  • int surface - Surface number.
  • int target - Target number.

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

Returns coordinate of a given vertex.

Arguments

  • int num - Vertex number.
  • int surface - Surface number.
  • int target - Target number.

Return value

Vertex coordinate.

virtual int getNumTangents (int surface) const =0

Returns the number of tangents in a given mesh surface.

Arguments

  • int surface - Surface number.

Return value

Number of the surface vertices.

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

Updates tangent of a given vertex.

Arguments

  • int num - Vertex number.
  • const quat & tangent - Vertex tangent.
  • int surface - Surface number.
  • int target - Target number.

virtual quat getTangent (int num, int surface, int target) const =0

Returns tangent of a given vertex.

Arguments

  • int num - Vertex number.
  • int surface - Surface number.
  • int target - Target number.

Return value

Tangent normal.

virtual vec3 getNormal (int num, int surface, int target) const =0

Returns normal of a given vertex.

Arguments

  • int num - Vertex number.
  • int surface - Surface number.
  • int target - Target number.

Return value

Normal vector.

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

Sets the number of first texture coordinates.

Arguments

  • int num - Number of first texture coordinates.
  • int surface - Surface number.

virtual int getNumTexCoords0 (int surface) const =0

Returns the number of first texture coordinates.

Arguments

  • int surface - Surface number.

Return value

Number of first texture coordinates.

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

Updates first texture coordinate.

Arguments

  • int num - Vertex number.
  • const vec2 & texcoord - Second texture coordinate.
  • int surface - Surface number.

virtual vec2 getTexCoord0 (int num, int surface) const =0

Returns first texture coordinate.

Arguments

  • int num - Vertex number.
  • int surface - Surface number.

Return value

Vertex first texture coordinate.

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

Sets the number of second texture coordinates.

Arguments

  • int num - Number of second texture coordinates.
  • int surface - Surface number.

virtual int getNumTexCoords1 (int surface) const =0

Returns the number of second texture coordinates.

Arguments

  • int surface - Surface number.

Return value

Number of second texture coordinates.

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

Updates second texture coordinate.

Arguments

  • int num - Vertex number.
  • const vec2 & texcoord - Second texture coordinate.
  • int surface - Surface number.

virtual vec2 getTexCoord1 (int num, int surface) const =0

Returns second texture coordinate.

Arguments

  • int num - Vertex number.
  • int surface - Surface number.

Return value

Vertex second texture coordinate.

virtual int getNumColors (int surface) const =0

Returns the number of vertex colors.

Arguments

  • int surface - Surface number.

Return value

Number of vertex colors.

virtual void setColor (int num, const vec4 & color, int surface) const =0

Updates vertex color.

Arguments

  • int num - Vertex number.
  • const vec4 & color - Vertex color.
  • int surface - Surface number.

virtual vec4 getColor (int num, int surface) const =0

Returns vertex color.

Arguments

  • int num - Vertex number.
  • int surface - Surface number.

Return value

Vertex color.

virtual int getNumCIndices (int surface) const =0

Returns the number of coordinate indices.

Arguments

  • int surface - Surface number.

Return value

Number of coordinate indices.

virtual void setCIndex (int num, int index, int surface) const =0

Updates an coordinate index.

Arguments

  • int num - Index number in the index buffer.
  • int index - Coordinate index.
  • int surface - Surface number.

virtual int getCIndex (int num, int surface) const =0

Returns an coordinate index.

Arguments

  • int num - Index number in the index buffer.
  • int surface - Surface number.

Return value

Coordinate index.

virtual int getNumTIndices (int surface) const =0

Returns the number of triangle indices.

Arguments

  • int surface - Surface number.

Return value

Number of triangle indices.

virtual void setTIndex (int num, int index, int surface) const =0

Updates a triangle index.

Arguments

  • int num - Index number in the index buffer.
  • int index - Triangle index.
  • int surface - Surface number.

virtual int getTIndex (int num, int surface) const =0

Returns a triangle index.

Arguments

  • int num - Index number in the index buffer.
  • int surface - Surface number.

Return value

Triangle index.

virtual int getNumSurfaceTargets (int surface) const =0

Returns the number of surface targets.

Arguments

  • int surface - Surface number.

Return value

Number of surface targets.

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

Returns the name of a given surface target.

Arguments

  • int surface - Surface number.
  • int target - Target number.

Return value

Target name.

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

Searches for an surface target with a given name.

Arguments

  • const char * name - Target name.
  • int surface - Surface number.

Return value

Target number if it is exists; otherwise, -1.
Last update: 2017-07-03