MD2
==

Your md2 files must be located in a directory in packages/models/.

You must provide a skin (either skin.jpg or skin.png) and the md2 itself (tris.md2).
Optionally you may provide a masks.jpg that holds a specmap in the R channel, a glowmap in the G channel, and a black B channel (future use). The engine will apply it automatically.

If either of these files is not found, Sauerbraten will search the parent directory for them. For example, if for the flags/red model, the tris.md2 is not found in packages/models/flags/red/, then it will look for tris.md2 in packages/models/flags/. This allows the sharing of skins and geometry.

Sauerbraten expects the md2 to use Quake-compatible scale and animations, unless you configure the model otherwise.

You may also supply a config file (md2.cfg) in your model directory, which allows you to customize the model's animations. The following commands may be used in an md2.cfg:

md2anim name frame numframes
md2anim name frame numframes speed

    "name" is the name of the animation to define. 
    Any of the following names may be used:
        dying
        dead
        pain
        idle
        idle attack
        run
        run attack
        edit
        lag
        jump
        jump attack
        gun shoot
        gun idle
        mapmodel
        trigger

    "frame" is the frame number the animation starts at.
    "numframes" is the number of frames in the animation.
    "speed" is the relative speed to run the animation at. This is optional and defaults to 100.

    Example: md2anim "run attack" 50 6 30
        Defines a "run attack" animation starting at frame 50 with 6 frames and running at 30% speed.      

mdlcollide N
    If N is 0, collisions with the model are disabled. Default = 1.

mdlbb RAD H
mdlbb RAD H EYE
    Sets the model's bounding box to radius RAD and height H. If this is not set, or RAD and H are 0, 
    a bounding box is automatically generated from the model's geometry. EYE is fraction of the model's height
    to be used as the eyeheight (default 0.9).

mdlcullface N
    If N is 0, backface culling is disabled for this model. Otherwise, backface culling is enabled. Default = 1.

mdlspec SI
    SI is the specular intensity (not given or 0 gives the default of 100, good for metal/plastics and anything shiny, use
    lower values like 50 for wood etc, -1 means off entirely)

mdlshader SH
    SH is the name of the shader to use for rendering the model. Default is "stdmodel".

mdlambient A
    A is the percent of the ambient light that should be used for shading. Not given or 0 gives the default of 30%, -1 means
    no ambient.

mdlscale S
    Scale the model's size to be S percent of its default size.

mdltrans X Y Z
    Translate the model's center by (X, Y, Z), where X/Y/Z are in model units (may use floating point).

