XML Files

vrecko is always launched using the binary vreckoApp.exe, which will load and create the scene and run the vrecko core itself. The whole content and behaviour of application depends on the content of XML files which are passed to the executable as a command line parameters.

Launching the application via command line may look like this:

vreckoApp.exe vr_base.xml vr_base_mouse.xml vr_scene_hci.xml -c vrecko_stereo.cfg

XML files contain the scene configuration while the CFG file determines the configuration of the graphical engine itself (if none is specified, vrecko.cfg will be loaded).

Configuration of the virtual scene

The virtual scene is defined by one or more XML files. These files contain the description of the virtual world such as

  • placement of objects in the virtual environment,
  • world properties (usually using abilities) – physics, lighting, etc.,
  • definitions of hardware devices – OptiTrack, Wii, etc.
  • and definitions of connections – who sends which messages to whom.

All XML files specified on the command line are formatted in the same way and on loading will all load as XML entity trees, which will be then merged and the resulting XML tree will be used to initialize the scene.

Merging XML files

The merging process is relatively intuitive and intelligent – for example, various EnvironmentObject nodes in two files can be added to the scene simultaneously, but if they have the same ID they are considered as a single instance and the second file on the command line can change parameters of the object in the first file.

Where to find the merged data

For the purpose of debugging the eventual errors, the result after merge operation is saved into log/debug_merged.xml (displays where each element is from) and log/debug_merged_nc.xml (the origins are not displayed but the content of the file is better arranged).

Controlling the merging

The default behavior for merging files can be changed on the level of the individual XML entities using MergeFlags attributes, e.g.:

<EnvironmentObject MergeFlags="delete">
   <ID>123</ID>
</EnvironmentObject>

If such block is used in a file then an object with an ID 123 will be found in the previously processed files, and if it exists it will be deleted.

There are several processing options available:

  • “modify” (default) = regular merge operation.
  • “add” = add an entity, even if a duplicity has been found.
  • “replace” = delete and replace the original entity along with the subtree.
  • “delete” = delete the original entity without replacement.

One of the below symbols can also be added before this value:

  • “?” (default) = regardless of whether the entity previously existed, it will be added or changed.
  • “+” = the object has to already exist for the changes to take place (otherwise the entire entity is ignored).
  • “-“ = the object cannot previously exist.

Dependencies

It is also possible to use the <Require> element in the root element, which will cause the processing of another file (before processing the current one). The dependencies can stack and can correctly arrange following files.

Reserved ID values

It is recommended to use only values above 500000000 (500 million).

  • 0 – PHANToM device / OptiTrack device
  • 5 – LSObject EO in LSystems ability
  • 6 – Keyboard and mouse device
  • 7 – OptiTrack device
  • 8 – Wiimote (primary)
  • 9 – Wiimote (secondary)
  • 11 – Kinect device
  • 1112 – Leap Motion device
  • 999000 – Phantom – the default object that the user holds if they have nothing else in their possession.
  • 1000001 – LSystems – terrain EO
  • 1100000 – Avatar
  • 1100001 – Avatar – right hand
  • 1100002 – Avatar – left hand
  • 1100003 – Avatar – head
  • 1100004 – Avatar – free move object
  • 1100052 – Avatar – second rendition of the left hand (transparent + on top)
  • 6062101 – ArtKit – ArtEnvironment ability
  • 60621001 – 60621999– reserved for ArtKit plug-in
  • 535969142 – Nature – Land ability EO identifier

Standard files

There are several XML files which provide basic functionality (such as support of input devices and movement around the scene) and which are used in almost every project.

These files are located in <vreckoDIR>\bin\Data\Common\XML and can be used by all vrecko developers. However, any and all changes should be consulted and approved beforehand.