A table structure representing a single bone's orientation when its mesh is in its baseline (or "bind") pose before any animation is played.
This structure does not contain the bone ID for the bone it represents and instead relies on the structure's index within the table returned by util.GetModelMeshes to identify the bone it corresponds to.
Example: Gets every bone's bind pose in model space, and relative to its parent bone (the form an animation sets a bone in).
local _, bindPoses
= util.
GetModelMeshes(
"models/player/kleiner.mdl" )
for boneId
= 0,
#bindPoses
do
local bindPose
= bindPoses
[ boneId
]
local boneToModel
= bindPose.
matrix:
GetInverseTR()
local parentBindPose
= bindPoses
[ bindPose.parent
]
local boneToParent
= parentBindPose
and parentBindPose.matrix
* boneToModel
or boneToModel
print( boneId,
boneToModel:
GetTranslation(),
boneToParent:
GetTranslation() )
end 0 -0.000005 -0.533615 38.566917 -0.000005 -0.533615 38.566917
1 -0.000000 2.448287 41.912045 0.000005 3.345128 -2.981901
2 0.000001 2.794612 45.915421 4.018327 -0.000001 -0.000000
3 ...