This page has been translated automatically.
Программирование
Fundamentals
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Rendering-Related Classes
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

Unigine::DecalMesh Class

Header:#include <UnigineDecals.h>
Inherits:Decal

This class describes how to create and modify mesh decals.

DecalMesh Class

Members


static DecalMeshPtr create(const Ptr<Mesh> & mesh, float radius, const char * name)

Constructor. Creates a new mesh decal with the given properties.

Arguments

  • const Ptr<Mesh> & mesh - Pointer to Mesh.
  • float radius - The height of the decal projection box along the Z axis, in units.
  • const char * name - Material name.

static DecalMeshPtr create(const char * mesh_name, float radius, const char * name)

Constructor. Creates a new mesh decal with the given properties.

Arguments

  • const char * mesh_name - Mesh name.
  • float radius - The height of the decal projection box along the Z axis, in units.
  • const char * name - Material name

Ptr<DecalMesh> cast(const Ptr<Node> & node)

Casts a mesh decal out of the Node instance.

Arguments

  • const Ptr<Node> & node - Node smart pointer.

Return value

Pointer to the DecalMesh.

Ptr<DecalMesh> cast(const Ptr<Decal> & base)

Casts a DecalMesh out of the Decal instance.

Arguments

  • const Ptr<Decal> & base - Decal smart pointer.

Return value

Pointer to the DecalMesh.

int setMesh(const Ptr<Mesh> & mesh)

Copies a given mesh into the current decal mesh.

Arguments

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

Return value

1 if the mesh is copied successfully; otherwise, 0.

int getMesh(const Ptr<Mesh> & mesh)

Copies the current decal mesh into the received mesh.

Arguments

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

Return value

1 if the mesh is copied successfully; otherwise, 0.

void setMeshName(const char * name)

Sets a new name for the mesh.

Arguments

  • const char * name - A new name to be set for the mesh.

const char * getMeshName()

Returns the name of the mesh used as a base for the decal.

Return value

The mesh name.

void setRadius(float radius)

Sets the new height of the decal projection box along the Z axis.

Arguments

  • float radius - The height of the decal projection box along the Z axis, in units.

float getRadius()

Returns the current height of the decal projection box along the Z axis.

Return value

The height of the decal projection box along the Z axis, in units.

void clearTopology()

Reverts a curved geometry back to flat.

int loadMesh(const char * name, int unique = 0)

Loads a mesh for the current mesh from the file. This function doesn't change the mesh name.

Arguments

  • const char * name - The name of the mesh file.
  • int unique - When you create several objects out of a single .mesh file, the instance of the mesh geometry is created. If you then change the source geometry, its instances will be changed as well. To avoid this, set the unique flag to 1, so a copy of the mesh geometry will be created and changes won't be applied.

Return value

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

int saveMesh(const char * name)

Saves the decal mesh into a file.

Arguments

  • const char * name - A name of the mesh file.

Return value

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

int type()

Returns a DecalMesh type identifier.

Return value

Type identifier.

void updateTopology()

Bends the decals geometry if it is a child of GeodeticPivot.
Last update: 03.07.2017
Build: ()