Unigine::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.
Unigine::WorldCluster Class
Members
static int type ()
WorldCluster type.Return value
WorldCluster type identifier.static Ptr< WorldCluster > create (const NodePtr & node)
WorldCluster constructor.Arguments
- const NodePtr & node - Node smart pointer.
static Ptr< WorldCluster > create ()
WorldCluster constructor.virtual Ptr< Node > getNode () const =0
Returns a node pointer.Return value
Node pointer.virtual int getNumReferences () const =0
Returns the total number of reference nodes contained in world clutter.Return value
The number of reference nodes.virtual const char * getReferenceName (int num) const =0
Returns the name of NodeReference contained in WorldCluster by its number.Arguments
- int num - NodeReference index number.
Return value
NodeReference name.virtual void setVisibleDistance (float distance) =0
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.
virtual float getVisibleDistance () const =0
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.virtual void setFadeDistance (float distance) =0
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.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.
virtual float getFadeDistance () const =0
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.In order for a fade distance to be applied, visibility distance should not be infinite.
Return value
Distance of fading for nodes in units.virtual void setShadowRadius (float radius) =0
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.
virtual float getShadowRadius () const =0
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.virtual int getNumNodes () const =0
Returns the total number of node references in the world cluster.Return value
Number of nodes.virtual const char * getNodeName (int num) const =0
Returns the name of the given node reference by its number.Arguments
- int num - Node reference number.
Return value
Name of the node reference.virtual mat4 getNodeTransform (int num) const =0
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.virtual NodeReference getNodeReference (int num) const =0
Returns the given node reference by its number.Arguments
- int num - Node reference number.
Return value
Node reference.virtual void createNodes (Ptr< NodePtr > & nodes) =0
Bakes the given reference nodes into one world cluster storing their coordinates.Arguments
- Ptr< NodePtr > & nodes - ID of node references array.
virtual void clearNodes () =0
Remove all reference nodes from the world cluster.Last update: 2017-07-03
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)