Started to fix rescue problem - more code cleanup will follow later.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@13022 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2013-06-28 23:45:48 +00:00
parent c5686dad01
commit 4616338fd6
3 changed files with 7 additions and 4 deletions

View File

@ -634,7 +634,7 @@ void LinearWorld::moveKartAfterRescue(AbstractKart* kart)
m_track->getAngle(sector)));
kart->getBody()->setCenterOfMassTransform(pos);
kart->setXYZ(pos.getOrigin());
//project kart to surface of track
bool kart_over_ground = m_track->findGround(kart);

View File

@ -538,9 +538,10 @@ void World::resetAllKarts()
//that at least one of its wheel will be on the surface of the track
for ( KartList::iterator i=m_karts.begin(); i!=m_karts.end(); i++)
{
///start projection from top of kart
btVector3 up_offset(0, 0.5f * ((*i)->getKartHeight()), 0);
(*i)->getVehicle()->getRigidBody()->translate (up_offset);
Vec3 xyz = (*i)->getXYZ();
//start projection from top of kart
Vec3 up_offset(0, 0.5f * ((*i)->getKartHeight()), 0);
(*i)->setXYZ(xyz+up_offset);
bool kart_over_ground = m_track->findGround(*i);

View File

@ -98,6 +98,8 @@ void TrackSector::update(const Vec3 &xyz)
} // update
// ----------------------------------------------------------------------------
/** Sets current and last valid graph node to the rescue location.
*/
void TrackSector::rescue()
{
if (m_last_valid_graph_node != QuadGraph::UNKNOWN_SECTOR)