This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

WorldSwitcher Class

This class allows to switch off (and turn on) big parts of the world at once. A switcher is made a parent for nodes it controls. It is of a box shape, and the distance from the camera can be measured to its edges or to its center.

WorldSwitcher Class

This class inherits from Node

Members


WorldSwitcher (vec3 size)

Creates a switcher for child nodes.

Arguments

  • vec3 size - Box dimensions in units.

float getMaxDistance ()

Returns the current maximum distance of visibility. If a camera is further from a node than this maximum distance, a node is not visible. The default is INFINITY.

Return value

Maximum distance of visibility in units.

float getMinDistance ()

Returns the current minimum distance of visibility. If a camera is closer to a node than this minimum distance, a node is not visible. The default is -INFINITY.

Return value

Minimum distance of visibility in units.

vec3 getOffset ()

Returns the current coordinates of the switcher box center.

Return value

Switcher box center coordinates.

vec3 getSize ()

Returns the current size of a switcher.

Return value

Box dimensions in units.

int isPoint ()

Returns a reference point to measure distance from a camera to the bounding box center or the bounding box edges. The default is 0 (box edges).

Return value

1 if the distance is measures to the box center; 0 if to the box edges.

void setMaxDistance (float distance)

Sets the maximum distance of visibility. If a camera is further from a node than this maximum distance, a node is not visible. The default is INFINITY.

Arguments

  • float distance - Maximum distance of visibility in units.

void setMinDistance (float distance)

Sets the minimum distance of visibility. If a camera is closer to a node than this minimum distance, a node is not visible. The default is -INFINITY.

Arguments

  • float distance - Minimum distance of visibility in units.

void setOffset (vec3 offset)

Sets coordinates of the switcher box center.

Arguments

  • vec3 offset - Switcher box center coordinates.

void setPoint (int point)

Specifies a reference point to measure distance from a camera to the bounding box center or the bounding box edges. The default is 0 (box edges).

Arguments

  • int point - 1 to measure the distance to the box center; 0 to measure it to the box edges.

void setSize (vec3 size)

Sets the size of a switcher.

Arguments

  • vec3 size - Box dimensions in units.
Last update: 2017-07-03
Build: ()