Error message

Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in _menu_load_objects() (line 579 of /home/drbiz/public/tools.realism.com/includes/menu.inc).

Revision of Event model from Thu, 10/22/2015 - 16:36

See 4.4.8 Event model for original text. Needs to be re-written to match HTML events.

Overview

There is no change from the original text. See 4.4.8.1 Event model / Events.

Routes

There are minimal changes from the original text (see 4.4.8.2 Event model / Routes).

  1. References to Run-time name scope (2nd paragraph) refer to DOM Environment name scope
  2. The 5th paragraph (refering to prototypes) does not apply.

Execution Model

X3D events in the DOM Environment follow the W3C event model except that events do not "bubble-up" from a node to its parent. Event time stamps are the actual time (according to the DOM environment) when the event happens. Events are processed in order received by the node either though a ROUTE from another X3D node or from an external source (typically JavaScript generated). Events arriving at the same time may be processed in any order and it is not a priori known.

An event may cause a node to genereate one or more events. These new events are generated with their own timestamp and may different (but will always be no earlier) than the initiating time stamp. If a node generates more than one event in response to an incoming event, the events may have different time stamps. The entire collection of events generated from an input event is called an event cascade.

The rendering engine determines how frequently to update the display. The updating of the display may occur asynchronously with the evaluation of events, sensor inputs, and other calculations. It is the responsibility to the display engine to manage the processing of events, inputs, and calculations with the updating of the display to achieve the desired user experience.

probably need a figure here to illustrate event processing with rendering updates

Loops

Event cascades may contain loops where an event E is routed to a node that generates an event that eventually results in E being generated again. Since the time stamp of each event is determined by the environment, there is no loop in the traditional X3D sense. As a result, there is no explict loop breaking mechanism. It is possible for a single event to trigger the entire operation of the X3D system until the user terminates the X3D scene.

Fan-in and fan-out

Fan-in occurs when two or more events (either by routes or DOM events) are targeted to the same destination field. The node processes events in a first-in, first-done order.

Fan-out occurs when one field is the source for more than one route. This results in sending any event generated by the field along all routes. The events may have the same time stamp.