mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-16 18:01:40 +00:00
rebase
This commit is contained in:
parent
503d7cf081
commit
8dbcaf25c3
1 changed files with 0 additions and 37 deletions
|
@ -1386,43 +1386,6 @@ void GenericCAO::updateAnimationSpeed()
|
|||
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()
|
||||
{
|
||||
ClientActiveObject *parent = getParent();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue