CalVR Config File
The CalVR config file holds all the configuration information for the CalVR kernel and its plugins. The $CALVR_CONFIG_FILE environment variable specifies a colon separated list of files to load. The files can either be an absolute path or a path relative to the default config directory. This directory defaults to $CALVR_HOME/config but can be changed with the $CALVR_CONFIG_DIR if needed.
Include, local and Priority
Each xml file has the option of including other xml files, for example:
Where this tag is in the file is not important, its contents is added to global scope.
If you want to allow for different information to be visible on different rendernodes, for a screen configuration for example, you need to use local tags:
<LOCAL host="calit2-137-110-111-71.ucsd.edu" > <NumPipes value="1" /> </LOCAL>
The host attribute is a comma separated list of hosts that will see this tag structure. The LOCAL tag itself is transparent to the application, and thus should not appear in the tag path.
When looking for a config file value, all open xml files are searched until the first instance of the tag/attribute pair is found. If not found, the default value is returned. The file search order starts with the root config file, then looks in its first included file, then those included from that file, etc., then the root's second included file, then its included files... Basically, tag/attribute combinations in a file will override the value defined in any of its included files. If multiple files are listed in $CALVR_CONFIG_FILE, the first file and its includes are search before next file listed, and so on.
CalVR uses the following tag values from the global scope with the following default values:
<MultiThreaded value="SingleThreaded" />
Sets the thread model for rendering. Uses a osgViewer::ViewerBase::ThreadingModel value: "SingleThreaded", "CullThreadPerCameraDrawThreadPerContext", "CullDrawThreadPerContext", "DrawThreadPerContext"
<RenderOnMaster value="true" />
Sets if the master node in a cluster setup should draw. A graphics window is still opened and all other things occure, but the cull/draw is skipped.
<Freeze value="false" />
When set to "true", the camera position stops getting updated by the tracked head position.
<SyncToVBlank value="false" />
When set to "true", sets driver hint to sync buffer swap to vertical blanking.
<Near value="10.0" />
Sets the near plane value for cameras.
<Far value="10000000" />
Sets the far plane value for cameras.
<Stereo separation="64.0" />
Value to use for distance between left and right eye for stereo rendering.
<Stencil value="false" />
Sets if the graphics window should be created with a stencil buffer.
<ShowAxis value="false" />
When set to "true", an coord axis is displayed for world space, object space, each hand and each head. x = red, y = green, z = blue.
<UseDepthPartition value="false" />
When set to "true", a depth partition node is used at the scene root. This is useful when you have scenes too large to set a static near/far value and there is lots of empty space within the depth range. (i.e. ossimPlanet viewing)
<HidePointer value="false" />
When set to "true" the wand pointers for the hands are not visible.
<CullingMode value="CALVR" />
This value sets what CullVisitor to use for the scene. The options are "CALVR" for our custom visitor and "DEFAULT" for the osg default visitor. The CalVR visitor has some modifications for cluster graphics and uses some special node masks. See CalVR Node Masks
<ConfigDebug value="false" />
When set to "true", all config value requests are printed with whatever value was found.
This is a simple example of tracking configuration:
<Input> <Threaded FPS="60.0" /> <TrackingSystem0 value="MOUSE"> <Offset x="0" y="0" z="0" /> <Orientation h="0" p="0" r="0" /> <NumBodies value="1" /> <NumButtons value="3" /> <NumValuators value="0" /> <Body0> <Offset x="0" y="0" z="0" /> <Orientation h="0" p="0" r="0" /> </Body0> </TrackingSystem0> <NumHeads value="0" /> <NumHands value="1" /> <Hand0> <Address system="0" body="0" /> <ButtonMask system0="0xFF" /> </Hand0> </Input>
Tracking is configured by defining the tracking systems being used and how the input from these systems is mapped to head(s) and hand(s). The above example is a simple setup that could be used by a desktop. It defines the basic mouse tracking system with with one tracked body and three buttons. There are 0 tracked heads define, so the ViewerPosition value will be used for the head position/orientation. There is 1 hand that uses the mouse body and buttons.
I will now go into more detail on configuring these tags.
An arbitrary number of tracking systems may be define with TrackingSystem# tags. The only restriction is that the system number must start with 0 and must increment without skipping.
Within the TrackingSystem# tag there are various options.
<Offset x="0" y="0" z="0" /> <Orientation h="0" p="0" r="0" />
These values define a global transform of the tracking data. The orientation rotates the coordinates of the system and the offset provides a global transformation.(transforms applied roll->pitch->heading)
<NumBodies value="1" /> <NumButtons value="3" /> <NumValuators value="0" />
These values define the number of tracked bodies, buttons, and valuators(analog) values in this tracking system.
<Body#> <Offset x="0" y="0" z="0" /> <Orientation h="0" p="0" r="0" /> </Body#>
These tags allows you to provide a translation/rotation correction on each tracked body in the system(replace # with body id)
To define the heads being tracked, you must first state the number of heads.
<NumHeads value="1" />
There must be an entry to define each head.
<Head#Address system="0" body="0" />
The system is the tracking system id and the body is the body id within the tracking system.
Note: When the number of heads is set to 0 the default viewer position/orientation is used and not updated.