Fixed steering direction for animation, and made animation smoother

(i.e. when steering left and then start turning right, the animation
started only after the 'straight ahead' point was reached, now the
animation will start immediately).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3723 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2009-07-09 04:25:38 +00:00
parent 0340a352fb
commit 2474e7a164

View File

@ -265,8 +265,8 @@ void KartModel::update(float rotation, float visual_steer,
// (say) 50% of left or right.
int end;
static int last_end=-1;
if(steer<0.0f) end = m_af_left;
else if(steer>0.0f) end = m_af_right;
if(steer>0.0f) end = m_af_straight-(int)((m_af_straight-m_af_left)*steer);
else if(steer<0.0f) end = m_af_straight+(int)((m_af_straight-m_af_right)*steer);
else end = m_af_straight;
// No changes to current frame loop