This page has been translated automatically.
Programming
Fundamentials
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Core Library
Containers
Engine Classes
Node-Related Classes
Rendering-Related Classes
Physics-Related Classes
Bounds-Related Classes
GUI-Related Classes
Controls-Related Classes
Pathfinding-Related Classes
Utility Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Switcher

A switcher is an object that disables or enables its child nodes at the specified distance to the camera. Possible use cases can be the following:

  • Enabling one object and disabling another at the specified distance
  • Disabling an object while moving away
  • Enabling an object while approaching
Notice
To be operated, the child nodes of the switcher should be placed inside the switcher object fully or partially.

Each object at the picture is composed from a switcher and 2 spheres of different color.

See Also

Adding a Switcher

To add a switcher to the scene via UnigineEditor, do the following:

  1. Run UnigineEditor.
  2. On the Menu bar, click Create -> World -> Switcher.

  3. Place the object somewhere in the world.
  4. Make the object that will be operated the child of the switcher.
  5. Specify the switcher parameters and the distance of enabling / disabling.

Switching between Two Objects

To switch between two object at the specified distance (like shown at the picture above), do the following:

  1. Create a node dummy for convenient grouping.
  2. Make the first switcher the child of the node dummy.
  3. Make the first object the child of the first switcher and specify its maximum visibility distance.
  4. Make the second switcher the child of the node dummy.
  5. Make the second object the child of the second switcher and specify its minimum visibility distance.

    Notice
    For objects to be switched at the same point, the maximum visibility distance of the first and minimum visibility distance of the second should match.

Switcher Parameters

In the Switcher tab you can adjust the following parameters of the switcher:

A Switcher tab

Bounding Box Parameters

A set of bounding box parameters:

Point A flag, indicating if the distance to the object is counted from the center of the bounding box (if disabled, the distance will be counted from its nearest edge).
Size The size of the switcher's bounding box along the X, Y and Z axes, in units.
Offset The offset of the switcher's bounding box along the X, Y and Z axes, in units.

Switching Parameters

Switching of distances:

Min distance The minimum distance of visibility, in units. If a camera is closer to a node than this minimum distance, a node is not visible.
Max distance The maximum distance of visibility, in units. If a camera is further from a node than this maximum distance, a node is not visible.
Last update: 2017-07-03
Build: ()