New feature: XML IO

There's now a new package, com.jmex.physics.io, that allows you to use XML files to map physics to spatials in a jME node. Check out the FormatTest.



The sample file looks like this:


<?xml version="1.0" encoding="utf-8"?>
<physics>
   <world ups="100" stepsize="0.02">
      <gravity x="0" y="-9.82" z="0"/>
   </world>
   <object type="static" graphics="floor"/>
   <object type="dynamic" graphics="box" mass="10"/>
   <object type="dynamic" graphics="pyramid" mass="20" geom="sphere" radius="10"/>
   <object type="dynamic" graphics="torus" mass="20" geom="box" extentx="10" extenty="10" extentz="10"/>
   <object type="dynamic" graphics="cylinder" mass="20" geom="cylinder" length="5" radius="15"/>
</physics>



As you can see this allows you to specify objects and world settings. If an object element is missing a geom attribute, it'll get approximated to the spatials bounding volume. The "graphics" attribute refers to the ID of the spatial it's bound to.

Compounded objects and joints are not supported yet.

The MW3D team aims to make their editor export to this format.