Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
WorldLayer Class
Inherits: | Node |
This class describes how to create and modify world layers.
See Also#
A UnigineScript API sample <UnigineSDK>/data/samples/worlds/layer_00
WorldLayer Class
Members
static WorldLayer ( vec3 size, string name ) #
Constructor. Creates a new layer with the specified parameters.Arguments
- vec3 size - Size of the new layer.
- string name - Name of the new layer.
static WorldLayer cast ( Node node ) #
Casts a WorldLayer out of the Node instance.Arguments
- Node node - Node instance.
Return value
WorldLayer instance.void setClearDistance ( float distance ) #
Sets a new clear distance parameter value. Starting with this distance, the node wouldn't be loaded in the background.Arguments
- float distance - Clear distance value, units.
float getClearDistance ( ) #
Returns the current clear distance parameter value.Return value
Clear distance value, units.void setLoadDistance ( float distance ) #
Sets a new load distance parameter value. Starting with this distance, the node will be loaded in the background.Arguments
- float distance - Load distance value, units.
float getLoadDistance ( ) #
Returns the current load distance parameter value.Return value
Load distance value, units.Node getNode ( int num ) #
Returns a specified node inside of the world layer.Arguments
- int num - Number of the node in range from 0 to the total number of nodes.
Return value
Specified node.Node getNode ( ) #
Returns a specified node inside of the world layer.Return value
Specified node.void setNodeGroup ( int group ) #
Sets a new priority group value. Greater priority means faster loading.Notice
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.Return value
Priority group value.void setNodeName ( string name ) #
Sets the new world node name.Arguments
- string name - Name of the node.
string getNodeName ( ) #
Returns the current name of the world node.Return value
World node name.void setNodeWeight ( float weight ) #
Sets the node weight value. Greater weight means faster loading inside the same priority group.Notice
Layers with identical groups and weights will be loaded in the alphabetical order.
Arguments
- float weight - New weight value.
float getNodeWeight ( ) #
Returns the current node weight value.Return value
Weight value.int getNumNodes ( ) #
Returns the number of nodes inside of the world layer.Return value
Number of nodes.void setOffset ( vec3 offset ) #
Sets coordinates of the layer box center.Arguments
- vec3 offset - Layer box center coordinates.
vec3 getOffset ( ) #
Returns the current coordinates of the layer box center.Return value
Layer box center coordinates.void setPoint ( int point ) #
Sets a layer as Point (its distance is counted from the bounding box center).Arguments
- int point - 1 to enable Point flag; 0 to disable it.
int isPoint ( ) #
Returns a value indicating if the layer is set as Point (its distance is counted from the bounding box center).Return value
1 if the layer is set as Point ; otherwise - 0.void setSize ( vec3 size ) #
Sets the new size for the layer.Arguments
- vec3 size - New size of the layer.
vec3 getSize ( ) #
Returns the current size of the layer.Return value
Size of the layer.static int type ( ) #
Returns the type of the node.Return value
World type identifier.Last update:
2019-08-16
Help improve this article
(or select a word/phrase and press Ctrl+Enter)