ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

HVA

From ModEnc
Jump to navigation Jump to search

HVA files (Hierarchical Voxel Animation, file extension .hva) contain additional information regarding a voxel model: section position, section rotation, and frame count. As its name suggests, HVA allows the voxel model to be animated when multiple frames are defined. In-game, a voxel unit is animated when moving, or in case of jumpjet units in RA2/YR, both when moving and hovering.

Each HVA frame has its own position and rotation offsets for every section in the voxel model. By manipulating these offsets, you can produce a smooth animation across the frames. See the Transformation Matrix section below for more information.

Examples of animated models include the Mammoth Mk. II in TS and the Siege Chopper in YR.

Note that HVA files are essential; when the game loads a voxel file (e.g. tank.vxl), if it doesn't find the accompanying HVA file (tank.hva), the game will crash.

Transformation Matrix

The HVA file contains a standard transformation matrix, which allows manipulating the voxel model in 3D space: rotating, shearing, positioning, or scaling. Each HVA frame contain a separate matrix and for each voxel section, allowing each section to be manipulated independently for each frame to produce an animation.

The matrix appears as follows:

Width Y to X Shear Y to Z Shear X Offset
X to Y Shear Height Z to Y Shear Y Offset
X to Z Shear Y to Z Shear Length Z Offset

X is left/right, Y is up/down, Z is forward/backward. The offset values are in voxels. Width, height, and length are multipliers.

Shearing essentially rotates one axis towards another. For example, positive values on the "Y to X Shear" variable rotate all points (voxels) along the Y axis towards the X axis (points up from the origin are rotated left, points down are rotated right).

See Also