NodeTrigger Class
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 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
NodeTrigger ()
Constructor. Creates a new trigger node.void setPositionCallback (CallbackBase * callback)
Sets a callback function to be fired when the trigger node position has changed. The callback function should accept a NodeTrigger that fired the callback as its first argument. In addition, it can also take any other two arguments. However, it can also receive no arguments.Arguments
- CallbackBase * callback - Name of the callback function.
string getPositionCallbackName ()
Returns the name of callback function to be fired on changing the trigger node position. This callback function is set via setPositionCallbackName().Return value
Name of the callback function.void setPositionCallbackName (string name)
Sets a callback function to be fired when the trigger node position has changed. The callback function should accept a NodeTrigger that fired the callback as its first argument. However, it can also receive no arguments.Arguments
- string name - Name of the callback function.
string getEnabledCallbackName ()
Returns the name of callback function to be fired on enabling the trigger node. This callback function is set via setEnabledCallbackName().Return value
Name of the callback function.void setEnabledCallback (CallbackBase * callback)
Sets a callback function to be fired when the trigger node is enabled. The callback function should accept a NodeTrigger that fired the callback as its first argument. In addition, it can also take any other two arguments. However, it can also receive no arguments.Arguments
- CallbackBase * callback - Name of the callback function.
void setEnabledCallbackName (string name)
Sets a callback function to be fired when the trigger node is enabled. The callback function should accept a NodeTrigger that fired the callback as its first argument. However, it can also receive no arguments.Arguments
- string name - Name of the callback function.
Last update: 2017-07-03
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)