Obstacles can be made out of different materials of varying properties. Materials are defined in the materials.xml list.
Original material.xml file:
<materials>
<material name="steel" density="1" friction="0.9" color="1 1 1" type="metal"/>
<material name="wood" density="1" friction="0.9" color="0.8 0.7 0.6" type="marble" forcelimit="0.05"/>
<material name="glass" density="1" friction="0.7" restitution="0.3" color="0.5 1.0 0.5" type="glass" forcelimit="0.1"/>
<material name="door" density="100" static="2" friction="0.7" color="0.5 0.5 0.5" type="metal" category="2" mask="125"/>
</materials>
You can easily make a new material by adding a new entry to the material list:
<material name="hardglass" density="1.3" friction="0.9" color="0.7 0.5 0.3" type="glass" forcelimit="0.3"/>
It can then be used in obstacle scripts:
mgMaterial("hardglass")
All material properties:
type - Material type (glass, metal, marble, plain). Controls the texture. marble and plain are unused.
color - Color of the material.
density - Material density.
friction - Material friction.
restitution - Material restitution (bounciness).
forcelimit - How much force needs to be applied in order to break the material
roundness - Material roundness.
static - Set to 1 to make it completely immovable. Set to 2 to make it impossible to rotate.
category - Unknown. Value is a bitmask.
mask - Unknown. Value is a bitmask.
All properties (except type) can be set in the obstacle script for individual property editing: mgColor, mgDensity, mgFriction, mgRestitution, mgForceLimit, mgRoundness, mgStatic, mgCategory, mgMask.