This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
FAQ
编程
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
应用程序接口
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
CIGI Client Plugin
Rendering-Related Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::WorldCluster Class

Header:#include <UnigineWorlds.h>
Inherits:Node

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


static WorldClusterPtr create()

Constructor. Creates a new world cluster.

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

Casts a WorldCluster out of the Node instance.

Arguments

  • const Ptr<Node> & node - Pointer to Node.

Return value

Pointer to WorldCluster.

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.

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.

Ptr<NodeReference> getNodeReference(int num)

Returns the given node reference by its number.

Arguments

  • int num - Node reference number.

Return value

Node reference.

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 getNumNodes()

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

Return value

Number of nodes.

int getNumReferences()

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

Return value

The number of reference nodes.

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.

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.

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.

void clearNodes()

Remove all reference nodes from the world cluster.

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.

int type()

Returns the type of the node.

Return value

World type identifier.
Last update: 2018-04-26
Build: ()