Unigine.WorldCluster Class
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.
See Also#
A UnigineScript API sample <UnigineSDK>/data/samples/worlds/cluster_00
WorldCluster Class
Properties
int NumNodes#
The total number of node references in the world cluster.
float FadeDistance#
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.
set
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.
set value -
Distance of fading for nodes in units. If a negative value is provided, 0 will be used instead.
float VisibleDistance#
The current distance up to which all the nodes comprising the world cluster will be rendered.
set
Updates the distance up to which all the nodes comprising the world cluster will be rendered.
set value -
Distance of visibility in units. If a negative value is provided, 0 will be used instead.
int NumReferences#
The total number of reference nodes contained in world clutter.
Members
static WorldCluster ( ) #
Constructor. Creates a new world cluster.static WorldCluster Cast ( Node node ) #
Casts a WorldCluster out of the Node instance.Arguments
- Node node - Node instance.
Return value
WorldCluster instance.string 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.NodeReference GetNodeReference ( int num ) #
Returns the given node reference by its number.Arguments
- int num - Node reference number.
Return value
Node reference.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.string 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 ClearNodes ( ) #
Remove all reference nodes from the world cluster.void CreateNodes ( Node[] nodes ) #
Bakes the given reference nodes into one world cluster storing their coordinates.Arguments
- Node[] nodes - ID of node references array.
static int type ( ) #
Returns the type of the node.Return value
World type identifier.Last update:
2019-08-16
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)