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
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Migration
Migrating to UNIGINE 2.0
C++ API Migration
Migrating from UNIGINE 2.0 to UNIGINE 2.1
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::WorldTrigger Class

Interface for world trigger handling. See also the UnigineScript analog.

To use this class, include the UnigineWorldTrigger.h file.

Unigine::WorldTrigger Class

Members


static int type ()

WorldTrigger type.

Return value

WorldTrigger type identifier.

static Ptr< WorldTrigger > create (const NodePtr & node)

WorldTrigger constructor.

Arguments

  • const NodePtr & node - Node smart pointer.

static Ptr< WorldTrigger > create (const vec3 & size)

WorldTrigger constructor.

Arguments

  • const vec3 & size - World trigger size.

virtual Ptr< Node > getNode () const =0

Returns a node pointer.

Return value

Node pointer.

virtual void setTouch (int touch) const =0

Sets a touch mode for the trigger. With this mode on, the trigger will react to the node by partial contact. When set to off, the trigger reacts only if the whole bounding sphere/box gets inside or outside of it. The default is 0.

Arguments

  • int touch - Touch mode flag: 1 to enable the touch mode, 0 to disable it.

virtual int isTouch () const =0

Returns a value indicating if a touch mode is enabled for the trigger. With this mode on, the trigger will react to the node by partial contact. When set to off, the trigger reacts only if the whole bounding sphere/box gets inside or outside of it.

Return value

Returns 1 if the touch mode is enabled; otherwise, 0.

virtual void setSize (const vec3 & size) const =0

Updates the current dimensions of the world trigger. The minimum size is vec3(0,0,0).

Arguments

  • const vec3 & size - Dimensions of the world trigger.

virtual vec3 getSize () const =0

Returns the current dimensions of the world trigger.

Return value

Current dimensions of the world trigger.

virtual void setTargetNodes (const Vector< NodePtr > & nodes) const =0

Sets a list of target nodes, which will fire callbacks. If this list is empty, all nodes fire callbacks.

Arguments

  • const Vector< NodePtr > & nodes - Target nodes vector.

virtual void getTargetNodes (Vector< NodePtr > & nodes) const =0

Returns the current list of target nodes, which fire callbacks. If this list is empty, all nodes fire callbacks.

Arguments

  • Vector< NodePtr > & nodes - Target nodes vector.

virtual void setTargetTypes (const Vector< int > & nodes) const =0

Sets a list of target node types, which will fire callbacks. If this list is empty, all nodes fire callbacks.

Arguments

  • const Vector< int > & nodes - Target node types vector.

virtual void getTargetTypes (Vector< int > & nodes) const =0

Returns the current list of target node types, which fire callbacks. If this list is empty, all nodes fire callbacks.

Arguments

  • Vector< int > & nodes - Target node types vector.

virtual void setExcludeNodes (const Vector< NodePtr > & nodes) const =0

Sets a list of excluded nodes, on which the world trigger will not react.

Arguments

  • const Vector< NodePtr > & nodes - Exclude nodes vector.

virtual void getExcludeNodes (Vector< NodePtr > & nodes) const =0

Returns the current list of excluded nodes, on which the world trigger does not react.

Arguments

  • Vector< NodePtr > & nodes - Exclude nodes vector.

virtual void setExcludeTypes (const Vector< int > & nodes) const =0

Sets a list of excluded node types, on which the world trigger will not react.

Arguments

  • const Vector< int > & nodes - Exclude node types vector.

virtual void getExcludeTypes (Vector< int > & nodes) const =0

Returns the current list of excluded node types, on which the world trigger does not react.

Arguments

  • Vector< int > & nodes - Exclude node types vector.

virtual int getNumNodes () const =0

Returns the number of nodes contained in the world trigger.

Return value

Number of nodes contained in the trigger.

virtual NodePtr getNode (int num) const =0

Returns a specified node contained in the world trigger.

Arguments

  • int num - Node number in range from 0 to the total number of nodes.

Return value

Specified node.

virtual void getNodes (Vector< NodePtr > & nodes) const =0

Gets nodes contained in the trigger.

Arguments

  • Vector< NodePtr > & nodes - Contained nodes vector.

virtual void setEnterCallbackName (const char * name) const =0

Sets a callback function to be fired when nodes are entering the world trigger. Unlike setEnterCallback(), this callback function accepts a node that entered the world trigger and world trigger itself as arguments.

Arguments

  • const char * name - World script function name.

virtual const char * getEnterCallbackName () const =0

Returns the name of callback function to be fired on entering the world trigger. This callback function is set via setEnterCallbackName().

Return value

World script function name.

virtual void setLeaveCallbackName (const char * name) const =0

Sets a callback function to be fired when nodes are leaving the world trigger. Unlike setLeaveCallback(), this callback function accepts a node that left the world trigger and world trigger itself as arguments.

Arguments

  • const char * name - World script function name.

virtual const char * getLeaveCallbackName () const =0

Returns the name of the callback function name to be fired on leaving the world trigger. This callback function is set via setLeaveCallbackName().

Return value

World script function name.

virtual void setEnterCallback (CallbackBase * func) const =0

Sets a pointer to a callback to be fired when nodes are entering the world trigger.

Arguments

  • CallbackBase * func - Callback pointer. The callback arguments must be (NodePtr,...).

virtual void setLeaveCallback (CallbackBase * func) const =0

Sets a pointer to a callback to be fired when nodes are leaving the world trigger.

Arguments

  • CallbackBase * func - Callback pointer. The callback arguments must be (NodePtr,...).
Last update: 2017-07-03
Build: ()