SceneGraph
Home | About XEngine | Engine API | SceneGraph | Changelog | Programming Guide |
Index| Scene Description Language | camera | directory | eventmessage | geometry | group | input | light | node | primitives | root | spinner | transformation | user | |
Eventmessage
Derived from: | - |
Class name: | - |
Description: | Declares an association between an event that is produced by the incuding (parent) node and a message that should be sent to a recipient node. |
Function List
Name | XE_eventmessage_create |
Arguments | int parent_node_id, const char* event_name, int recipient_node_id, const char* msg, float notification_delay |
Return Type | bool |
Description | Creates an event message For each node type, a number of events is available in order to perform a certain action. For example: XE_eventmessage_create(input_id, "button1pressed", user_id, "input none", 0.0f); In the above case, the Input node generates an event each time button 1 is pressed. When button 1 pressed is pressed, a message is posted to the specified user node which sets the attached input to none (deactivates keyboard input). Parameters: - parent_node_id, the node that generates the event - event_name, the name of the event - recipient_node_id, the recipient of the event - msg, the message of the event - notification_delay, the delay in seconds that need to pass before the event is sent to the recipient Returns true if the parent node id was found |
Notes: |
Name | XE_eventmessage_post |
Arguments | int node_id, const char* msg |
Return Type | bool |
Description | Posts an event message Similarly to the above function, a message can be created and posted explicitly only once during the next update. For example: XE_eventmessage_post(user_id, "input none"); In the above case, the user node receives a message that removes any attached input. See function KeyPressedSpecialOperations() in Input.cpp Parameters: - node_id - the recipient of the message - msg - the message of the event Returns true if the node id was found |
Notes: |
Scene Description Language Declaration
XML node name | eventmessage | |||||||||||||||
Placement: | Within any node | |||||||||||||||
Special notes: | Multiple eventmessages can be included within the scope of a node, even if they respond to the same event. This is necessary if you need to notify many nodes at once when an event occurs. The event, message and recipient attributes are mandatory. | |||||||||||||||
Inherited attributes: | - | |||||||||||||||
New attributes: |
|
|||||||||||||||
Events: |
|
|||||||||||||||
Inherited events: | - | |||||||||||||||
New messages: |
|
|||||||||||||||
Inherited messages: | - | |||||||||||||||
Redefined messages: | - | |||||||||||||||
Obsolete messages: | - |
Example
<world ambient="0.3 0.3 0.3" background="0.2 0.2 0.2"> <camera name="first_person" aperture="50.0" near="2.0" far="1000" follow="Myself" primary="true"> </camera> <transformation name="environment" scale="1.0,1.0,1.0" translation="0,0,-10"> <object name="geom2" file="arena.obj"></object> </transformation> <user name="Myself" control="navigate" speed="2.0" turn="0.5" position="0,10,100" lookat="0,10,0" input="MouseKeyboard"> </user> <input name="MouseKeyboard" devicename="device0"> <eventmessage event="button3pressed" recipient="%Myself" message="input none"> </eventmessage> <eventmessage event="button1pressed" recipient="%Myself" message="input Console"> </eventmessage> </input> </world> |
Last updated: 3 Jun. 2013