Add temporary code for GE spm

This commit is contained in:
Benau 2022-05-21 08:55:59 +08:00
parent 3b0df18167
commit 350773d316
2 changed files with 8 additions and 2 deletions

View File

@ -256,7 +256,8 @@ void ModelViewWidget::setupRTTScene()
scene::ISceneNode* parent = bone_attachment ?
animated_node->getJointNode(m_bone_attached[n].c_str()) :
m_rtt_main_node;
assert(parent);
if (!parent)
continue;
if (m_model_frames[n].first == -1)
{
scene::ISceneNode* node =

View File

@ -1328,6 +1328,8 @@ void KartModel::initInverseBoneMatrices()
node->setCurrentFrame(striaght_frame);
node->OnAnimate(0);
scene::IBoneSceneNode* bone = node->getJointNode(i);
if (!bone)
continue;
bone->updateAbsolutePosition();
node->setCurrentFrame(striaght_frame);
node->OnAnimate(0);
@ -1352,8 +1354,11 @@ void KartModel::initInverseBoneMatrices()
const core::matrix4& KartModel::getInverseBoneMatrix
(const std::string& bone_name) const
{
// Remove after GESPM animation is done
static core::matrix4 unused;
assert(m_version >= 3);
auto ret = m_inverse_bone_matrices.find(bone_name);
assert(ret != m_inverse_bone_matrices.end());
if (ret == m_inverse_bone_matrices.end())
return unused;
return ret->second;
} // getInverseBoneMatrix