Update the kart translation after it was reset at the start of the

race. This way getXYZ() and getTrans() now report the correct 
position after the kart were reset, before the first frame (i.e.
before Moveable::update() is called the first time).
This caused the referee position to be inconsistent between 
tracks (and this will for now cause the referee position to be
bad ... but at least the same bad in all tracks ;) ).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9897 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2011-09-26 22:11:30 +00:00
parent f6607dc77c
commit 2590a8236a

View File

@ -514,16 +514,22 @@ void World::resetAllKarts()
}
} // while
// Now store the current (i.e. in rest) suspension length for each kart,
// so that the karts can visualise the suspension.
for ( KartList::iterator i=m_karts.begin(); i!=m_karts.end(); i++)
{
// Now store the current (i.e. in rest) suspension length for each
// kart, so that the karts can visualise the suspension.
(*i)->setSuspensionLength();
for(unsigned int i=0; i<m_karts.size(); i++)
if(m_karts[i]->getCamera())
m_karts[i]->getCamera()->setInitialTransform();
// Initialise the camera (if available), now that the correct
// kart position is set
if((*i)->getCamera())
(*i)->getCamera()->setInitialTransform();
// Update the kart transforms with the newly computed position
// after all karts are reset
(*i)->setTrans((*i)->getBody()->getWorldTransform());
}
} // resetAllKarts
// ----------------------------------------------------------------------------
void World::schedulePause(Phase phase)
{
if (m_schedule_unpause)
@ -535,8 +541,9 @@ void World::schedulePause(Phase phase)
m_schedule_pause = true;
m_scheduled_pause_phase = phase;
}
}
} // schedulePause
// ----------------------------------------------------------------------------
void World::scheduleUnpause()
{
if (m_schedule_pause)
@ -547,7 +554,7 @@ void World::scheduleUnpause()
{
m_schedule_unpause = true;
}
}
} // scheduleUnpause
//-----------------------------------------------------------------------------
/** This is the main interface to update the world. This function calls