VRSPEC Detailed Description

VRSPEC Detailed Description



VR Object Specification
-----------------------
Defining an object within a virtual world involves specifying its
type, giving it a name and specifying its attributes.  Currently,
the object specification language supports the following VR objects:

        - World Object
        - Light Source Objects
        - Room Objects
        - Fixed Objects
        - Movable Objects
        - Door Objects
        - Path Objects
        - Sensor Objects
        - Audio Objects

The notion of a room is actually that of a collection of VR objects
(movables, fixed objects, doors, audio objects, etc.) that should be
grouped together.  Using the term 'room' is not meant to imply it has
walls, a floor or a ceiling.  In fact, a room does not have to have a
model associated with it. 'Turning Off' a room makes all objects
associated with that room invisible (not drawn, not intersected and
not updated).

The attributes for each object type vary but several attributes are
shared across several objects.  Examples of common attributes are
ModelFile, CollideMode and Pickable.

The 'ModelFile' attribute specifies the name of the file containing the
model that will represent the object.

The 'CollideMode' attribute defines how objects doing collision detection
will interact with the object being specified.  Currently, there are four
collide modes: Ghost, Stop, Notify and StopNotify.  Objects with CollideMode
'Ghost' will not be processed during the intersection traversal.  The mode
'Stop' will return a successful intersection during the intersection traversal.
'Notify' is used to specify that a collision event should be placed on the
event queue if the object being specified is intersected.  Objects with
CollideMode 'StopNotify' will return a successful intersection AND add a
collision event when intersected.

The 'Pickable' attribute specifies that an object is pickable.  If
an object is specified as 'pickable', a Pick event will be added to the
event queue whenever it is picked (selected by the pointing device).


VR Event Specification
----------------------
The event specification has three parts:

        - State Data Token Specification
        - Initial Action Specification
        - Event Handler Specification

State data tokens can be used to make decision during the VR simulation.
To use a state data token, it must be defined in the state data token
specification. State data tokens can be used to make handlers or specific
actions within handlers conditional. They can also be used to logically
partition event handlers into related groups or states.

The initial action specification is a list of actions that will be used
to initialize the VR simulation environment when the simulation is started
or reset.  These actions are the same as the actions specified in an event
handler.

Specifying how the VR objects will behave during the simulation is
done through user defined event handlers.  An event handler is made up
of a header and an action list.  The header specifies the type of handler
and information to identify the event it should handle.  Currently, there
are five types of events in vrSpec:

        - Pick
        - Collision
        - Motion End
        - Timer
        - User Input

Actions are commands that change the simulation environment or the
objects within the simulation environment.  There are currently over 30
actions that can be used within a handler action list.  These include
commands for:

        - Printing trace messages
        - Issuing audio commands (load, unload, play, repeat, stop, etc.)
        - Changing Movable Objects (new motion, new position, reset, etc.)
        - Updating state data tokens (set, reset, toggle)
        - Activating and deactivating VR objects
        - Turning Light Sources on and off
        - Turning rooms on and off
        - Releasing a room's textures from texture memory
        - Opening/closing and locking/unlocking doors
        - Invoking user defined functions
        - Timer manipulations (Add, AddRandom, Reset, Kill)
        - Simulation control (reset, end)


Movable object Motion
---------------------
Moving an object through a virtual world can be accomplished in one of
many ways whether it be by user input devices or run-time calculations
based on numeric equations or hard coded paths.  These motions can also
be very specific to a given simulation (e.g., following a hallway).

vrSpec simplifies the way in which motion is applied to objects and it
provides a framework that structures motion definitions allowing
modularization and reuse.

vrSpec does this by abstracting the notion of motion allowing users to
define object motion any way they see fit.  This is accomplished through
'Motion Functions' or mofuncs.  Mofuncs represent ANY motion (including
the lack of motion as in the SitAndDoNothing mofunc) and can be
assigned to any movable object.

Using the vrSpec path compiler, mofuncs can be converted to compiled
paths that are used in the object specification.  These 'compiled' paths
allow complex (cpu intensive) motion without the run-time cost (a space
for time trade-off). 

Wavefront data can also be imported into vrSpec using a utility that
converts the Wavefront animation data into a vrSpec compiled path.

The bottom line: mofuncs encapsulate ALL motion.  As an example, if a
movable object is to follow one of these compiled paths, it would be
assigned the FollowHardPath motion function.  

Users can use the Wavefront interface, existing motion functions or write
their own using the C programming language.  Motion Functions are linked
into vrSpec via the motion function table.


The vrSpec Command
------------------
The object specification can be spread across several files while the
event specification MUST be contained in a single file.  To simplify
managing these files, a VR specification file can be defined containing
a list of the object specification files and the event file.  vrSpec
is then invoked with the specification file name (if there is only one
object specification file, the user can just specify the object and
event specification filenames on the command line using the '-c' option).

Usage:
       vrSpec [-deioqsDLT] SpecFileName

       vrSpec -c [-deioqsDLT] ObjectFileName EventFileName

        c     - Specify Object and Event files on Command line
        d     - Turn Debugging ON
        i     - Only print 'Print' command data (overrides d)
        e     - Print event data after it is loaded
        o     - Print object data after it is loaded
        L     - Only load Spec Data, Don't load models, Don't run the Simulation        q     - Quiet mode - disable audio interface.
        s     - Turn statistics ON
        D     - Dump the scene graph to scene.dump
        T     - Dump the texture names to texture.dump: by rooms



Back to VRSPEC Page.