This page has been translated automatically.
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
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Unigine::Decal Class

Interface for decal handling.

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

Unigine::Decal Class

Members


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

Decal constructor.

Arguments

  • const NodePtr & node - Node smart pointer.

virtual Ptr< Decal > getDecal () const =0

Returns a decal pointer.

Return value

The decal pointer.

virtual void setViewportMask (int mask) const =0

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.

virtual int getViewportMask () const =0

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.

virtual void setInitTime (float time) const =0

Sets a time period of initialization.

Arguments

  • float time - Time in seconds.

virtual float getInitTime () const =0

Returns the time period of initialization.

Return value

Time in seconds.

virtual void setLifeTime (float time) const =0

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.

virtual float getLifeTime () const =0

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.

virtual void setFadeTime (float time) const =0

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.

virtual float getFadeTime () const =0

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

Return value

Time in seconds.

virtual void setMinVisibleDistance (float distance) const =0

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.

virtual float getMinVisibleDistance () const =0

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.

virtual void setMinFadeDistance (float distance) const =0

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.

virtual float getMinFadeDistance () const =0

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.

virtual void setMaxVisibleDistance (float distance) const =0

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.

virtual float getMaxVisibleDistance () const =0

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.

virtual void setMaxFadeDistance (float distance) const =0

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.

virtual float getMaxFadeDistance () const =0

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.

virtual void setTexCoord (const vec4 & texcoord) const =0

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 vec4 & texcoord - Texture coordinates for the decal.

virtual vec4 getTexCoord () const =0

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.

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

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.

virtual MaterialPtr getMaterial () const =0

Returns the material used for the decal.

Return value

Smart pointer to the material used for the decal.

virtual MaterialPtr getMaterialInherit () const =0

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.

virtual int isMaterialInherited () const =0

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.

virtual const char * getMaterialName () const =0

Returns the name of a decal material.

Return value

The material name.
Last update: 2017-07-03
Build: ()