Making DOOM 3 Mods : Walk IK
Walk Inverse Kinematics makes feet stay on the floor, even when walking along uneven terrain.

The IK animation controller for a walking character can be enabled with key/value pairs in the entityDef.

ik_numLegs <num>Sets the number of legs
ik_minWaistFloorDist <game units> Sets the minimum distance of the waist to the ground.
This minimum distance is usually only used for crawling creatures like the trite. If not required do NOT use the key/value pair or set it to zero to save CPU.
ik_minWaistAnkleDist <game units> Sets the minimum distance of the waist to one of the ankles.
This minimum distance makes sure the waist is always a certain distance above the ankles.
ik_footSize <game units> Sets the size of a foot
A square of the given size is used to find the height of the floor below a foot. If set to zero a single point is used which is considerably cheaper and used for instance for the trite.
ik_waist <jointName> Sets the joints used for the walk IK.
Where <X> is the leg number starting at 1. So a biped uses 1 and 2, and the trite uses 1 up to 6.

The ik_foot joint specifies the location at which the floor height is sampled.

The two bones modified by the walk IK go from ik_hip to ik_knee and from ik_knee to ik_ankle.

The vector from the ik_knee joint to the ik_dir joint specifies the direction the walk IK will bend knee.

ik_dir<X> <jointName>
ik_hip<X> <jointName>
ik_knee<X> <jointName>
ik_ankle<X> <jointName>
ik_foot<X> <jointName>
ik_waist <jointName> The ik_waist joint is used to shift the whole upper body up and down based on how far the feet are moved up and down and how far the knees are bent.
Example
entityDef monster_demon_imp {
    "inherit"          "monster_default"
    "scriptobject"     "monster_demon_imp"
    "model"            "monster_demon_imp"
    "ragdoll"          "monster_demon_imp"
    ...
    "ik_numLegs"       "2"
    "ik_footSize"      "4"
    "ik_waist"         "Body"
    "ik_hip1"          "Lupleg"
    "ik_hip2"          "Rupleg"
    "ik_knee1"         "Lloleg"
    "ik_knee2"         "Rloleg"
    "ik_ankle1"        "Lankle_r"
    "ik_ankle2"        "Rankle_r"
    "ik_dir1"          "Lknee"
    "ik_dir2"          "Rknee"
    "ik_foot1"         "Lball_r"
    "ik_foot2"         "Rball_r"
    ...
}

Copyright © 2004 id software