This page has been translated automatically.
编程
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Rendering-Related Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::NodeTrigger Class

Header:#include <UnigineNodes.h>
Inherits:Node

A trigger node is a zero-sized node that has no visual representation and fires callbacks when:

  • It is enabled/disabled (the enabled callback function is called)
  • Its transformation is changed (the position callback function is called)
The trigger node is usually added as a child node to another node, so that the callbacks will be fired on the parent node enabling/disabling or transforming.
Notice
The enabled and position callback functions should be implemented in the world script.

For example, to detect if some node has been enabled (for example, a world clutter node that renders nodes only around the camera has enabled it), the trigger node is added as a child to this node and fires a corresponding callback.

NodeTrigger Class

Members


static NodeTriggerPtr create()

Constructor. Creates a new trigger node.

Ptr<NodeTrigger> cast(const Ptr<Node> & node)

Casts a NodeTrigger out of the Node instance.

Arguments

  • const Ptr<Node> & node - Pointer to Node.

Return value

Pointer to NodeTrigger.

void setEnabledCallback(const Ptr<PositionCallback> & func)

Sets a pointer to a callback to be fired when the trigger node is enabled.

Arguments

  • const Ptr<PositionCallback> & func

void setEnabledCallbackName(const char * name)

Sets a callback function to be fired when the trigger node is enabled. This function should take a NodeTrigger, which fires the callback, as the first argument.

Arguments

  • const char * name - World script function name.

const char * getEnabledCallbackName()

Returns the name of callback function to be fired on enabling the trigger node. This function is set by using the setEnabledCallbackName() function.

Return value

World script function name.

void setPositionCallback(const Ptr<PositionCallback> & func)

Sets a pointer to a callback to be fired when the trigger node has been changed.

Arguments

  • const Ptr<PositionCallback> & func

void setPositionCallbackName(const char * name)

Sets a callback function to be fired when the trigger node position has been changed. This function should take a NodeTrigger, which fires the callback, as the first argument.

Arguments

  • const char * name - World script function name.

const char * getPositionCallbackName()

Returns the name of callback function to be fired on changing the trigger node position. This function is set by using the setPositionCallbackName() function.

Return value

World script function name.

int type()

Returns the type of the node.

Return value

NodeTrigger type identifier.
Last update: 2017-07-03
Build: ()