mirror of
https://github.com/luanti-org/luanti.git
synced 2025-11-09 03:25:28 +01: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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user