Triggers
Triggers are the key to creating user interactivity in Ygdrasil. Triggers work on a system of events and responses. An event can be a user action such as moving into a certain area, or pressing a button on the wand, or just moving the wand around. The response can be one or more messages sent to different nodes when the event occurs.Different nodes have different events that they will respond to.
Types of Triggers
There are several different kinds of triggers you can use that do different things. Some work by creating activated areas within the scenes, others are attached to specific objects.
userTrigger
The userTrigger responds to a user entering or leaving a defined volume, which can be either a box or a sphere.
Events:
- enter
- exit
wandTrigger
works like the userTrigger, but responds to the wand instead of the user's head.the wandTrigger also has events for pressing the buttons. Events:
- enter
- exit
- button1, button2, button3
- buttonUp2, buttonUp2, buttonUp3
pointAtTrigger
a grouping node; it responds to the wand pointing at any of its children.unlike the userTrigger and wandTrigger, you don't define a volume for the pointAtTrigger.
Events:
- enter
- exit
- button1, button2, button3
- buttonUp2, buttonUp2, buttonUp3
Examples
Door Opening and Closing(c) Ben Chang