Advanced topics

Injecting data in included files

A typical case is that you have: And you want to combine the two, i.e. put the camera on the pan-tilt unit. One way to achieve the desired result is to just copy-paste the contents of the stereo camera defintion into the pan-tilt definition file. This works but is less than ideal if you have several different types of appliances you use on the same pan-tilt unit model. Not to mention that the files become messy rather quickly.

To facilitate a more modular approach, peekabot allows injection of objects into included subtrees. Assume we want the stereo camera (defined in "sth.xml") added under the "pan.tilt" object from "ptu.xml". This is simple with <inject> element:

<?xml version="1.0">
<scene>
  <include file="ptu.xml">
    <inject at="pan.tilt">
      <include file="sth.xml"/>
    </inject>
  </include>
</scene>

Of course, if you need to inject objects at several places can use several <inject> elements.

External blocks

To support interoperability with other tools and applications, scene definition files can contain <external> elements that are ignored by peekabot. Although markup contained in an external-block is ignored by peekabot, its contents still has to be well-formed.

External blocks are generally allowed everywhere in scene files - in the top scope of scene files, in color elements, in layer elements and object definition elements (e.g. <sphere>). They are not, however, allowed e.g. inside <scale>-elements.

A typical usage scenario where <external> blocks is storing non-peekabot data in the same file, e.g. information used by a simulator simulating the specified world.

Example
<scene>
  <external>
    <g>9.82</g>
    <drag_coeff>2</drag_coeff>
    <disable_collisions/>
  </external>
  ...
</scene>

Get peekabot at SourceForge.net. Fast, secure and Free Open Source software downloads
Generated on Tue Mar 17 22:47:13 2009 for peekabot by  doxygen 1.5.6