This page has been translated automatically.
Programming
Fundamentials
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
Bounds-Related Classes
Containers
Controls-Related Classes
Core Library
Engine-Related Classes
GUI-Related Classes
Node-Related Classes
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Rendering-Related Classes
Utility Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Decal Class

Interface for decal handling.

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

Decal Class

Members


Ptr<Decal> getDecal ()

Returns a decal pointer.

Return value

The decal pointer.

float getInitTime ()

Returns the time period of initialization.

Return value

Time in seconds.

void setMaxVisibleDistance (float distance)

Updates the maximum visibility distance, starting at which the decal begins to fade out until becomes completely invisible.

Arguments

  • float distance - A new maximum visibility distance, in units. If a negative value is provided, 0 will be used instead.

void setViewportMask (int mask)

Sets a bit mask for rendering a decal into the viewport. The decal is rendered, if its mask matches the camera viewport mask and the viewport mask of the decal's material.

Arguments

  • int mask - An integer value, each bit of which is used to set a mask.

const char * getMaterialName ()

Returns the name of a decal material.

Return value

The material name.

float getFadeTime ()

Returns the time period during which the decal will fade away (after its life time exceeds).

Return value

Time in seconds.

float getMaxVisibleDistance ()

Returns the maximum visibility distance, starting at which the decal begins to fade out until becomes completely invisible.

Return value

The distance value, in units.

int getViewportMask ()

Returns the current bit mask for rendering into the viewport. The decal is rendered, if its mask matches the camera viewport mask and the viewport mask of the decal's material.

Return value

The integer value, each bit of which is used to set a mask.

Math::vec4 getTexCoord ()

Returns the texture coordinates for the decal (a texture atlas can be used).
  • The first pair of coordinates (x and y) set texture scale by the X and Y axes. For example, by the scale of 2 the texture is repeated twice on one decal.
  • The second pair (z and w) set texture offset along the X and Y axes. For example, by the offset of 0.5 along theX axis the texture is repositioned to the right (so that the edge of the texture is rendered in the center).

Return value

The current texture coordinates for the decal.

int isMaterialInherited ()

Returns the value indicating if a given material is inherited (instanced). Modifications made in a material instance do not affect the source material.

Return value

1 if the material is inherited successfully; otherwise, 0.

void setInitTime (float time)

Sets a time period of initialization.

Arguments

  • float time - Time in seconds.

void setMaxFadeDistance (float distance)

Updates the maximum fade-out distance, across which the decal smoothly becomes invisible due to the alpha fading. It is counted starting from the maximum visibility distance value.

Arguments

  • float distance - A new minimum fade-out distance, in units. If a negative value is provided, 0 will be used instead.

float getLifeTime ()

Returns the time period during which the decal will be projected.

Return value

Time in seconds. If a negative value is returned, the decal is permanent.

void setMinVisibleDistance (float distance)

Updates the minimum visibility distance, starting at which the decal begins to fade in and then becomes completely visible.

Arguments

  • float distance - A new minimum visibility distance, in units. If a negative value is provided, 0 will be used instead.

void setMinFadeDistance (float distance)

Updates the minimum fade-in distance, across which the decal smoothly becomes visible due to the alpha fading. It is counted starting from the minimum visibility distance value.

Arguments

  • float distance - A new minimum fade-in distance, in units. If a negative value is provided, 0 will be used instead.

float getMinFadeDistance ()

Returns the minimum fade-in distance, across which the decal smoothly becomes visible due to the alpha fading. It is counted starting from the minimum visibility distance value.

Return value

The distance value, in units.

void setTexCoord (const Math::vec4 & coord)

Sets texture coordinates for the decal (a texture atlas can be used).
  • The first pair of coordinates (x and y) set texture scale by the X and Y axes. For example, by the scale of 2 the texture is repeated twice on one decal.
  • The second pair (z and w) set texture offset along the X and Y axes. For example, by the offset of 0.5 along the X axis the texture is repositioned to the right (so that the edge of the texture is rendered in the center).

Arguments

  • const Math::vec4 & coord - Texture coordinates for the decal.

Ptr<Material> getMaterialInherit ()

Inherits material for the decal (creates a material instance). Modifications made in a new material instance will not affect the source material.

Return value

Smart pointer to the inherited material.

Ptr<Material> getMaterial ()

Returns the material used for the decal.

Return value

Smart pointer to the material used for the decal.

float getMaxFadeDistance ()

Returns the maximum fade-out distance, across which the decal smoothly becomes invisible due to the alpha fading. It is counted starting from the maximum visibility distance value.

Return value

The distance value, in units.

void setFadeTime (float time)

Sets a time period during which the decal will fade away (after its life time exceeds). The fade time is ignored if the decal is permanent (does not disappear).

Arguments

  • float time - Time in seconds.

void setLifeTime (float time)

Sets a time period during which the decal will be projected. By default the decal will not disappear and setFadeTime() will be ignored.

Arguments

  • float time - Time in seconds. If a negative value is provided, the decal will be permanent.

int setMaterial (const char * name)

Sets a new material for the decal.

Arguments

  • const char * name - Name of a new material.

Return value

1 if the material is set successfully; otherwise, 0.

float getMinVisibleDistance ()

Returns The minimum visibility distance, starting at which the decal begins to fade in and then becomes completely visible.

Return value

The distance value, in units.
Last update: 2017-07-03
Build: ()