Unigine::WorldLayer Class
Header: | #include <UnigineWorlds.h> |
Inherits: | Node |
This class describes how to create and modify world layers.
WorldLayer Class
Members
static WorldLayerPtr create(const Math::vec3 & size, const char * name)
Constructor. Creates a new layer with the specified parameters.Arguments
- const Math::vec3 & size - Size of the new layer.
- const char * name - Name of the new layer.
Ptr<WorldLayer> cast(const Ptr<Node> & node)
Casts a WorldLayer out of the Node instance.Arguments
- const Ptr<Node> & node - Pointer to Node.
Return value
Pointer to WorldLayer.void setClearDistance(float distance)
Sets the clearing distance. Starting with this distance, the node wouldn't be loaded in the background. The default is inf.Arguments
- float distance - New clearing distance in units.
float getClearDistance()
Returns the current clearing distance. Starting with this distance, the node wouldn't be loaded in the background.Return value
Current clearing distance in units. The default is inf.void setLoadDistance(float distance)
Sets a new loading distance. Starting with this distance, the node will be loaded in the background. The default is -inf.Arguments
- float distance - Loading distance in units.
float getLoadDistance()
Returns the current loading distance. Starting with this distance, the node will be loaded in the background.Return value
Loading distance in units. The default is -inf.Ptr<Node> getNode(int num)
Returns a node pointer.Arguments
- int num - Number of the node in range from 0 to the total number of nodes.
Return value
Node pointer.Ptr<Node> getNode()
Returns a node pointer.Return value
Node pointer.void setNodeGroup(int group)
Sets the priority group value. Greater priority means faster node loading. The default value is 0. Layers with identical groups and weights will be loaded in the alphabetical order.Arguments
- int group - Priority group value.
int getNodeGroup()
Returns the current priority group value. Greater priority means faster node loading. The default value is 0.Return value
Priority group value.void setNodeName(const char * name)
Sets a path to a node.Arguments
- const char * name - Path to a *.node file.
const char * getNodeName()
Returns the path to the node.Return value
Path to the *.node file.void setNodeWeight(float weight)
Sets the priority weight value. Greater weight means faster node loading inside the same priority group. The default value is 0. Layers with identical groups and weights will be loaded in the alphabetical order.Arguments
- float weight - New priority weight value.
float getNodeWeight()
Returns the current priority weight value.Return value
Current priority weight value.int getNumNodes()
Returns the number of nodes contained in the world layer.Return value
Number of nodes.void setOffset(const Math::vec3 & offset)
Sets offset of coordinates of the layer box center.Arguments
- const Math::vec3 & offset - Offset of layer box center.
Math::vec3 getOffset()
Returns the current offset of coordinates of the layer box center.Return value
Current offset of layer box center.void setPoint(int point)
Sets a point mode for the layer (its distance is counted from the bounding box center).Arguments
- int point - 1 to set a point mode, 0 not to set. The default is 0.
int isPoint()
Returns a value indicating if a point mode is set for the layer. The default is 0.Return value
1 if a point mode is set; otherwise, 0.void setSize(const Math::vec3 & size)
Updates layer size.Arguments
- const Math::vec3 & size - New size of the layer. The minimum value is vec3(0,0,0).
Math::vec3 getSize()
Returns the size of the layer.Return value
Current size of the layer.int type()
Returns the type of the node.Return value
World type identifier.Last update: 2018-04-26
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)