Cauldron3D.Formats.Mdl (Cauldron3D.Formats v0.2.2)

Copy Markdown View Source

A Quake model, .mdl, read into a Cauldron3D.Mesh and what the game needs besides.

{:ok, model} = Cauldron3D.Formats.Mdl.parse(bytes)
model.mesh
Cauldron3D.Formats.Mdl.pose(model, frame, time)

frames is a tuple with one entry per frame number the game uses: {:single, pose} or {:group, [{pose, until}]}, a group cycling through its poses, each shown until until seconds into the cycle. flags are the model's effect flags (rocket trail, grenade smoke, gib blood, rotation and so on), mins and maxs its box.

Summary

Functions

The model in data.

The mesh pose for frame number frame at time seconds; an unknown frame is the first.

Types

t()

@type t() :: %Cauldron3D.Formats.Mdl{
  flags: term(),
  frames: term(),
  maxs: term(),
  mesh: term(),
  mins: term()
}

Functions

parse(arg1)

@spec parse(binary()) :: {:ok, t()} | {:error, :not_a_model}

The model in data.

pose(mdl, frame, time)

@spec pose(t(), integer(), number()) :: non_neg_integer()

The mesh pose for frame number frame at time seconds; an unknown frame is the first.