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
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.

WorldCluster Class

WorldCluster bakes reference nodes into one world cluster and handles only visible nodes found within a specified distance from the camera. Further than this distance, nodes fade out and then disappear completely. There are two benefits of using WorldCluster:

  • Instances of nodes that are currently outside the view frustum are not stored in the memory, which provides much more efficient memory usage.
  • Less cluttered spatial tree, which allows, for example, faster collision detection.

WorldCluster Class

Members


WorldCluster ()

Constructor. Creates a new world cluster.

void setShadowRadius (float radius)

Updates the distance to draw additional meshes outside the view frustum. This option allows to eliminate popping of shadows at the edges of the screen when the camera is turning.

Arguments

  • float radius - Distance in units.

void setVisibleDistance (float distance)

Updates the distance up to which all the nodes comprising the world cluster will be rendered.

Arguments

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

void setFadeDistance (float distance)

Updates the distance up to which the nodes comprising the world cluster will be fading out (that is, fewer node references will be rendered instead of all). The distance is measured starting from the visible distance.
Notice
In order for a fade distance to be applied, visibility distance should not be infinite.

Arguments

  • float distance - Distance of fading for nodes in units. If a negative value is provided, 0 will be used instead.

Math::mat4 getNodeTransform (int num)

Returns the transformation of the given node reference by its number.

Arguments

  • int num - Node reference number.

Return value

Transformation matrix for the node reference.

int getNumReferences ()

Returns the total number of reference nodes contained in world clutter.

Return value

The number of reference nodes.

float getFadeDistance ()

Returns the current distance up to which the nodes comprising the world cluster are fading out (that is, fewer meshes will be rendered instead of all). The distance is measured starting from the visible distance.
Notice
In order for a fade distance to be applied, visibility distance should not be infinite.

Return value

Distance of fading for nodes in units.

const char * getNodeName (int num)

Returns the name of the given node reference by its number.

Arguments

  • int num - Node reference number.

Return value

Name of the node reference.

float getVisibleDistance ()

Returns the current distance up to which all the nodes comprising the world cluster will be rendered.

Return value

Distance of visibility for nodes in units.

const char * getReferenceName (int num)

Returns the name of NodeReference contained in WorldCluster by its number.

Arguments

  • int num - NodeReference index number.

Return value

NodeReference name.

Ptr<NodeReference> getNodeReference (int num)

Returns the given node reference by its number.

Arguments

  • int num - Node reference number.

Return value

Node reference.

float getShadowRadius ()

Returns the current distance to draw additional meshes outside the view frustum. This option allows to eliminate popping of shadows at the edges of the screen when the camera is turning.

Return value

Distance in units. If a negative value is provided, 0 will be used instead.

void createNodes (const Vector< Ptr<Node> > & nodes)

Bakes the given reference nodes into one world cluster storing their coordinates.

Arguments

  • const Vector< Ptr<Node> > & nodes - ID of node references array.

void clearNodes ()

Remove all reference nodes from the world cluster.

int getNumNodes ()

Returns the total number of node references in the world cluster.

Return value

Number of nodes.
Last update: 2017-07-03
Build: ()