mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-15 18:57:08 +00:00
Fix animation frame_speed and blend loosing precision due to incorrec… (#6357)
* Fix animation frame_speed and blend loosing precision due to incorrect data type Add lua function set_animation_frame_speed to update the frame speed without resetting the animation to start
This commit is contained in:
parent
b8f06ad37e
commit
bf403b923a
10 changed files with 74 additions and 5 deletions
|
@ -1150,9 +1150,17 @@ void GenericCAO::updateAnimation()
|
|||
#endif
|
||||
}
|
||||
|
||||
void GenericCAO::updateAnimationSpeed()
|
||||
{
|
||||
if (!m_animated_meshnode)
|
||||
return;
|
||||
|
||||
m_animated_meshnode->setAnimationSpeed(m_animation_speed);
|
||||
}
|
||||
|
||||
void GenericCAO::updateBonePosition()
|
||||
{
|
||||
if(m_bone_position.empty() || !m_animated_meshnode)
|
||||
if (m_bone_position.empty() || !m_animated_meshnode)
|
||||
return;
|
||||
|
||||
m_animated_meshnode->setJointMode(irr::scene::EJUOR_CONTROL); // To write positions to the mesh on render
|
||||
|
@ -1351,6 +1359,9 @@ void GenericCAO::processMessage(const std::string &data)
|
|||
updateAnimation();
|
||||
}
|
||||
}
|
||||
} else if (cmd == GENERIC_CMD_SET_ANIMATION_SPEED) {
|
||||
m_animation_speed = readF1000(is);
|
||||
updateAnimationSpeed();
|
||||
} else if (cmd == GENERIC_CMD_SET_BONE_POSITION) {
|
||||
std::string bone = deSerializeString(is);
|
||||
v3f position = readV3F1000(is);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue