HAnim PLG (RW Section)

From GTAModding
Jump to: navigation, search
RW Stream Section

HAnim PLG is a child section of the extension of the frame list section inside a DFF model. It defines information for bones which can be used inside animations to animate the object.


Each section gets started by some general information:

4b - RwUInt32 hAnimVersion - animation's version format (in all GTAs - 1.0 (0x100))
4b - RwUInt32 nodeId       - user Id for this bone
4b - RwUInt32 numNodes     - number of bones in hierarchy (if this bone is a root bone; for all other bones this parameter is set to 0)

If there are any affected bones then there are two more values following:

4b - RwUInt32 flags        - flags for hierarchy animation
4b - RwUInt32 keyFrameSize - size of data (in bytes) needed for one animaton frame (in GTA this parameter is equal to 36)

Those values are followed by an array of bone information. It's size gets defined above.

4b - RwUInt32 nodeId    - user Id for this bone
4b - RwUInt32 nodeIndex - bone index in this array
4b - RwUInt32 flags     - bone flags

Hierarchy animation flags

These flags are a set of parameters to create and update the hierarchy.

    1 SUBHIERARCHY            - hierarchy inherits from another hierarchy
    2 NOMATRICES              - hierarchy doesn't use local matrices for bones
 4096 UPDATEMODELLINGMATRICES - update local matrices for bones
 8192 UPDATELTMS              - recalculate global matrices for bones
16384 LOCALSPACEMATRICES      - hierarchy computes matrices in the local space

Bone flags

1 POPPARENTMATRIX  - this flag must be set for bones which don't have child bones
2 PUSHPARENTMATRIX - this flag must be set for all bones, except those which are the latest in a particular hierarchical level
8 - unknown flag

See also