Fixed flicker that sometimes occured when stopping model rotation
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@4159 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
@@ -108,6 +108,12 @@ void ModelViewWidget::update(float delta)
|
||||
angle -= delta*m_rotation_speed;
|
||||
}
|
||||
|
||||
// slow down when getting close
|
||||
if (fabsf(angle - m_rotation_target) < m_rotation_speed*5.0f)
|
||||
{
|
||||
m_rotation_speed = std::max(m_rotation_speed*0.9f, fabsf(angle - m_rotation_target));
|
||||
}
|
||||
|
||||
// stop rotating when target reached
|
||||
if (fabsf(angle - m_rotation_target) < 2.0f) m_rotation_mode = ROTATE_OFF;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user