mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Render animationless skeletal meshes in their bind pose at their current position, instead of rendering at the world's origin.
This was SVN commit r9182.
This commit is contained in:
@@ -275,8 +275,21 @@ void CModel::ValidatePosition()
|
||||
|
||||
m_Anim->m_AnimDef->BuildBoneMatrices(m_AnimTime, m_BoneMatrices, !(m_Flags & MODELFLAG_NOLOOPANIMATION));
|
||||
|
||||
const CMatrix3D& transform=GetTransform();
|
||||
for (size_t i=0;i<m_pModelDef->GetNumBones();i++) {
|
||||
const CMatrix3D& transform = GetTransform();
|
||||
for (size_t i = 0; i < m_pModelDef->GetNumBones(); i++)
|
||||
m_BoneMatrices[i].Concatenate(transform);
|
||||
}
|
||||
else if (m_BoneMatrices)
|
||||
{
|
||||
// Bones but no animation - probably a buggy actor forgot to set up the animation,
|
||||
// so just render it in its bind pose
|
||||
|
||||
const CMatrix3D& transform = GetTransform();
|
||||
for (size_t i = 0; i < m_pModelDef->GetNumBones(); i++)
|
||||
{
|
||||
m_BoneMatrices[i].SetIdentity();
|
||||
m_BoneMatrices[i].Rotate(m_pModelDef->GetBones()[i].m_Rotation);
|
||||
m_BoneMatrices[i].Translate(m_pModelDef->GetBones()[i].m_Translation);
|
||||
m_BoneMatrices[i].Concatenate(transform);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user