FORMAT OF WORLD & SEQUENCE FILES
--------------------------------
AERO data files are user-readable ASCII files. Comments start with a hash
mark ("#") and extend to the end of the line. Lower case characters denote an
optional value and need not be specified - in this case the default values
(often 0) are used.

STATE FORMAT

Z                             # begin of a new state
t <starttime:real>
g <gravity:vector>
s <seed value for random value generation:integer>

# any number of bodies
K<bodynr:+integer> <bodytype> <body geometry> <material>
m <mass:real>                 # mass in kg
p <position:vector>           # position of the center of gravity in meter
v <velocity:vector>           # in meter per second
a <acceleration:vector>       # [m/s^2]
q <quaternion>                #
w <vektor>                    # rotary velocity [rad/s]
u <vektor>                    # rotary acceleration [rad/s^2]
c <red:ushort> <green:ushort>> <blue:ushort>                 # color 
n <transparency:real> <reflexion:real> <roughness:real>      # for ray tracer
b -[g][m][k]                  # type of movement: no gravity, 
                              #      no mass, no collision check
i <idnr:long>                 # identification nummber

 
For a "composed" body, the corresponding embedded bodies with their 
parameters should be following the body definition.
The position of the composed object is computed as the center of gravity of
the embedded bodies!

E <bodytype> <geometry> <material>  # only cuboid, sphere and cylinder are allowed
m <mass:real>                       # mass [kg]
p <position:vektor>                 # position [m]
q <quaternion>                      # quaternion ref. Inertialsystem
c <red:ushort> <green:ushort> <blue:ushort>   # color
X                                   # end marker of a composed object

 
Links are entered as follows:

V<linknr> K<nr1> K<nr2> <linktype> <linkparameters>  # any number of links
a <linkpoint1:vektor>       # position of connection at body <nr1>
b <linkpoint2:vektor>       # and at body <nr2>


A constant force of <strength> is applied at a point of a body during the 
time intervall t0 and t1. 

F <t0:real> <t1:real> K<bodynr> [<point:vektor>] <forceparameter>

Q                           # denotes the end of the current state


For all definitions above, the following types apply:

 long   = 0..2^31
 ushort = 0..65535
 vector = <real> <real> <real>
 quaternion = <real> <real> <real> <real>
 bodytype = sphere | box | cylinder | plane | nail | mpoint | point | composed
 bodygeometry of "sphere"  = <radius:real>
 bodygeometry of "cylinder" = <radius:real> <height:real>
 bodygeometry of "box" = <xyz-dimensions:vector>
 
 <material> = material name from the material table e.g.: iron, plastic, ..
   # this is only set for sphere, box, cylinder und plane !

 <linktype> = spring | damper | joint | rod
 linkparameter for "spring" = <resting length:real> <spring constant:real>
 linkparameter for "damper" = <damping constant:real>
 linkparameter for "rod" = <length:real>

 <forceparameter> = inertial <force:vektor>  # const. force in inertial system [N]
 <forceparameter> = local <force':vektor>    # force ref to body coord. system
 <forceparameter> = guided <force:real> K<targetbody> [<target position:vektor>] 
             # constant force in [N] directed always to a point at the target body


The following samples show erroneous entries, which will be checked
when read by AERO:
 * Z
 * g 0 -9.81 0                       # negative gravity
 *
 * K1 box 0.1 0.2 0.3 iron           # iron cuboid falls down to nowhere
 * v -1.0 0 0
 *
 * K2 sphere 0.05 plastic            # plastic sphere as pendulum
 * p -2.0 10.0 0
 *
 * K3 nail
 * p 0.0 10.0 0.0
 *
 * V1 K2 K3 rod 2.0
 *
 * F1 K1 0 1 0 0 0 inertial 10 0 0   # force in the center of K1 in x-diection with
 *                                   # strength 10N is applied during time 0s <= t <= 1s
 * Q


MATERIAL FORMAT:

# this is an remark
M <maximum number of materials:Integer>
m <name:string> <density:real> <dynamic friction constant:real> 
  <static friction constant:real> 
  <impact value:real> <spring value:real> <damping value:real>
  [<default_red:ushort> <default_green:ushort> <default_blue:ushort> 
   <transparency:real> <reflexion:real> <roughness:real>]
# density in [kg/m^3]
# transparency in the interval 0..1
Q



CONFIGURATION FORMAT

P
h <integration step width:real> <min> <max>
e (Y|N) <eps:real>                  # error control Y(es) or N(o)
k (Y|N) <collision step width:real> # collision activated Y(es) or N(o)
b <max. resting speed:real> <min. penetration depth:real>
u <min. sliding speed:real> <min. rolling speed:real>
g (Y|N) <random gravity in %:real>
r <rod spring constant:real> <rod damping constant:real>   
j <joint spring constant:real> <joint damper constant:real>
m <minimal srping stretching:real>
q <maximal cuboid-collision diagonal depth:real>
s (Y|N)                             # spring impact YES, NO
a (Y|N) <cw-value of sphere:real> <cw-value of cuboid:real> <cw-value of cylinder:real>
Q


CAMERA FORMAT

The settings of the camera in the animation window are stored in order to get
the same camera settings as the last time. This is especially useful when
there are many objects and the camera is mounted.

K
p <position:vector>		# postion 
r <quaternion>			# specifies the direction to look
z <zoom:real>			# zoom factor
m <object-id:long>		# camera is mounted to object with object-id 
o <offset:vector>		# position local to the mounted object
Q				# end of camera specifications



The AERO internal format is now described by using an example.
Sample world (state) file:

W              # start world file
M 32           # material table, may contain 32 entries
               # two materials, "iron" and "wood" are entered
m iron 7.8000e+03 1.0000e+00 1.3000e+00 9.0000e-01 5.0000e+04 5.0000e+02
m wood 6.0000e+02 5.0000e-01 6.5000e-01 7.0000e-01 5.0000e+04 5.0000e+02
Q              # end of material table


Z              # start description of current state: objects, forces, and links
t 1            # time of state description
g 0 -9.81 0    # gravitation vector

               # object definitions start with letter "K" plus a number
               # "K1" is the first object: sphere, radius 5cm, material iron
K1 sphere 5.00000000e-02 iron
               # mass
m 4.08398627e+00 
               # position
p -2.14595881e-01 8.11705112e-02 0.00000000e+00
               # orientation
q 6.61532809e-01 0.00000000e+00 0.00000000e+00 -7.49916216e-01
               # velocity
v -1.54115612e-03 1.68088549e-03 0.00000000e+00
               # rotary velocity
w 0.00000000e+00 0.00000000e+00 1.72884763e-02

 
K2 nail        # object labelled "K2": immmovable point (nail)
p 0.00000000e+00 4.00000000e-01 0.00000000e+00


               # link definitions start with letter "V" plus a number
               # "V1" links objects K1 and K2 with a rod of specified length
V1 K1 K2 rod 3.26810113e-01
               # the following line(s) denotes the link's fixture point for
               # the first and/or second object (marked "a" or "b"), in case
               # it is not identical to an object's center.
a 3.75000000e-02 -4.00000000e-02 0.00000000e+00


V2 K1 K2 rod 4.12310563e-01
               # the second link "V2" is again between object K1 and K2
a 3.00000000e-02 4.00000000e-02 0.00000000e+00
b -5.50000000e-01 -3.12250226e-17 0.00000000e+00


               # force definitions start with letter "F"
               # next params: start and termination time for applying force
               # next params: object (here "K1"), force type (guided, 
               #  inertial, or local), force attack vector (includes strength)
F 1 1.01 K1 inertial 0 0 4

Q              # end description of current state
               # end of world file


Sequence files are similar to world files, however, they may contain several
"world" states. For these, a mark "X" has to be placed instead of the "state
end symbol Q" and "Y" marks the end of the sequence and is placed at the end
of the file.

