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版本。

ObjectBillboards Class

Interface for object billboards handling. See also the UnigineScript analog.

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

ObjectBillboards Class

Members


ObjectBillboards ()

Constructor. Creates a new Billboards object.

Math::vec3 getPosition (int num)

Returns the position of a given billboard. The default is vec3(0,0,0).

Arguments

  • int num - Billboard number in range from 0 to the total number of billboards.

Return value

Billboard position coordinates.

void removeBillboard (int num)

Removes a given billboard from the Billboard object.

Arguments

  • int num - Billboard number in range from 0 to the total number of billboards.

void setPosition (int num, const Math::vec3 & position)

Updates the position of a given billboard. The default is vec3(0,0,0).

Arguments

  • int num - Billboard number in range from 0 to the total number of billboards.
  • const Math::vec3 & position - New billboard position coordinates.

int getNumBillboards ()

Returns the total number of billboards contained in and managed by Billboards object.

Return value

Number of billboards.

float getHeight (int num)

Returns the height of a given billboard.

Arguments

  • int num - Billboard number in range from 0 to the total number of billboards.

Return value

Billboard height in units.

int addBillboard (float width, float height)

Adds a billboard with given width and height to be managed by the Billboards object. A position, texture coordinates and an angle of the new billboard are set to default:
  • position is set to vec3(0,0,0)
  • texture coordinates are set to vec4(1,1,0,0)
  • angle is set to 0.

Arguments

  • float width - Billboard width in units.
  • float height - Billboard height in units.

Return value

Number of the added billboard.

int getDepthSort ()

Returns a value indicating if the depth sorting (in back-to-front order) of billboards is enabled. The depth sorting should be enabled, if alpha blending is used for the billboard material.

Return value

Returns 1 if the depth sorting is enabled; otherwise, 0.

void setAngle (int num, float angle)

Updates an angle of a given billboard, which is used to set the billboard orientation.

Arguments

  • int num - Billboard number in range from 0 to the total number of billboards.
  • float angle - Billboard angle in degrees to set the billboard orientation. Positive values rotate the billboard clockwise, negative ones rotate it counter-clockwise.

void setWidth (int num, float width)

Updates a width of a given billboard.

Arguments

  • int num - Billboard number in range from 0 to the total number of billboards.
  • float width - New billboard width in units.

Math::vec3 getNormal (int num)

Returns the normal vector of a given billboard (used only with billboards_impostor_base material).

Arguments

  • int num - Billboard number in range from 0 to the total number of billboards.

Return value

Billboard normal coordinates local to the object.

float getAngle (int num)

Returns the angle of a given billboard, which is used to set the billboard orientation.

Arguments

  • int num - Billboard number in range from 0 to the total number of billboards.

Return value

Billboard angle in degrees. The default is 0 degrees.

void allocateBillboards (int num)

Allocates a buffer for a given number of billboards that will be created.

Arguments

  • int num - The number of billboards to be created in the allocated buffer.

void setHeight (int num, float height)

Updates a height of a given billboard.

Arguments

  • int num - Billboard number in range from 0 to the total number of billboards.
  • float height - New billboard height in units.

void setDepthSort (int sort)

Sets a value indicating if the depth sorting (in back-to-front order) of billboards is enabled. The depth sorting should be enabled, if alpha blending is used for the billboard material.

Arguments

  • int sort - 1 to enable the depth sorting, 0 to disable it. The default is 0.

Math::vec4 getTexCoord (int num)

Returns the texture coordinates of a given billboard. The default is vec4(1,1,0,0).
  • The first pair of coordinates (x and x) sets texture scale by X and Y axes. For example, by the scale of 2 the texture is repeated twice on the billboard.
  • The second pair (z and w) set texture offset along X and Y axes. For example, by the offset of 0.5 along X axis the texture is repositioned to the right (so that the edge of the texture is rendered in the center).

Arguments

  • int num - Billboard number in range from 0 to the total number of billboards.

Return value

Billboard texture coordinates.

void setTexCoord (int num, const Math::vec4 & texcoord)

Updates texture coordinates of a given billboard. The default is vec4(1,1,0,0).
  • The first pair of coordinates (x and x) sets texture scale by X and Y axes. For example, by the scale of 2 the texture is repeated twice on the billboard.
  • The second pair (z and w) set texture offset along X and Y axes. For example, by the offset of 0.5 along X axis the texture is repositioned to the right (so that the edge of the texture is rendered in the center).

Arguments

  • int num - Billboard number in range from 0 to the total number of billboards.
  • const Math::vec4 & texcoord - New texture coordinates.

void clearBillboards ()

Deletes all billboards from the Billboards object.

void setNormal (int num, const Math::vec3 & normal)

Updates a normal vector of a given billboard, which is used to orient billboard (used only with billboards_impostor_base material).

Arguments

  • int num - Billboard number in range from 0 to the total number of billboards.
  • const Math::vec3 & normal - Billboard normal coordinates local to the object.

float getWidth (int num)

Returns the width of a given billboard.

Arguments

  • int num - Billboard number in range from 0 to the total number of billboards.

Return value

Billboard width in units.
Last update: 2017-07-03
Build: ()