1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-16 18:01:40 +00:00
This commit is contained in:
Lars Mueller 2025-01-20 02:42:16 +01:00
parent 503d7cf081
commit 8dbcaf25c3

View file

@ -1386,43 +1386,6 @@ void GenericCAO::updateAnimationSpeed()
m_animated_meshnode->setAnimationSpeed(m_animation_speed); m_animated_meshnode->setAnimationSpeed(m_animation_speed);
} }
void GenericCAO::updateBones(f32 dtime)
{
if (!m_animated_meshnode)
return;
if (m_bone_override.empty())
return;
// FIXME these need to be applied at a different point in time
// in order to be relative to the animated bone positions of the current frame
for (auto &it : m_bone_override) {
std::string bone_name = it.first;
scene::IBoneSceneNode* bone = m_animated_meshnode->getJointNode(bone_name.c_str());
if (!bone)
continue;
BoneOverride &props = it.second;
props.dtime_passed += dtime;
bone->setPosition(props.getPosition(bone->getPosition()));
bone->setRotation(props.getRotationEulerDeg(bone->getRotation()));
bone->setScale(props.getScale(bone->getScale()));
}
// The following is needed for set_bone_pos to propagate to
// attached objects correctly.
// Irrlicht ought to do this, but doesn't when using EJUOR_CONTROL.
for (u32 i = 0; i < m_animated_meshnode->getJointCount(); ++i) {
auto bone = m_animated_meshnode->getJointNode(i);
// Look for the root bone.
if (bone && bone->getParent() == m_animated_meshnode) {
// Update entire skeleton.
bone->updateAbsolutePositionOfAllChildren();
break;
}
}
}
void GenericCAO::updateAttachments() void GenericCAO::updateAttachments()
{ {
ClientActiveObject *parent = getParent(); ClientActiveObject *parent = getParent();