This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
Sandworm
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
创建内容
Content Optimization
Materials
Art Samples
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

World Trigger

A world trigger is a cuboid shaped object, which fires callbacks when any node (collider or not) gets inside or outside of it. This trigger can be used to detect nodes and access their components and parameters.

A World Trigger Affecting Meshes

See also#

  • WorldTrigger class to manage world triggers via API
  • A set of samples located in the data/samples/worlds folder:
    1. trigger_01
    2. trigger_02

Creating a World Trigger#

To create a world trigger via UnigineEditor:

  1. On the Menu bar, choose Create -> Logic -> World Trigger

    Trigger Creation
  2. Place the node in the scene.

Editing a World Trigger#

In the Node tab of the Parameters window, you can adjust the following parameters of the trigger:

Node tab of the World Trigger node

Bounding Box Parameters

A set of bounding box parameters:

Edit Size Toggles the editing mode for the world trigger node on and off. When enabled, the bounding box sides that can be resized are highlighted with the colored rectangles. To change the size of a side, drag the corresponding rectangle.

Touch Toggles the touch mode for the trigger on and off. With this mode on, the trigger reacts to the node at a partial contact. Otherwise, the trigger reacts only if the whole bounding box gets inside it.
Size The size of the trigger's bounding box along the X, Y, and Z axes, in units.

Setting Up Callbacks#

To add an enter or leave callback, write a callback function that receives a Node as its first argument. Then use an addEnterCallback or addLeaveCallback method to specify the function to be called.

Source code (C++)
// add the enter callback to be fired when a node enters the world trigger
worldTrigger->addEnterCallback(MakeCallback(this, &AppWorldLogic::enter_callback));
// add the leave callback to be fired when a node leaves the world trigger
worldTrigger->addLeaveCallback(MakeCallback(this, &AppWorldLogic::leave_callback));
Source code (C#)
// add the enter callback to be fired when a node enters the world trigger
worldTrigger.AddEnterCallback(enter_callback);
// add the leave callback to be fired when a node leaves the world trigger
worldTrigger.AddLeaveCallback(leave_callback);
Last update: 2021-04-29
Build: ()