Fixed distance computation (was still using up instead of forward index).

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/switch_coordinate_system@4979 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-03-11 22:07:50 +00:00
parent 5de3555ac2
commit 0848fe1349

View File

@ -107,7 +107,7 @@ void GraphNode::addSuccessor(unsigned int to)
*/
void GraphNode::getDistances(const Vec3 &xyz, Vec3 *result)
{
core::vector2df xyz2d(xyz.getX(), xyz.getY());
core::vector2df xyz2d(xyz.getX(), xyz.getZ());
core::vector2df closest = m_line.getClosestPoint(xyz2d);
if(m_line.getPointOrientation(xyz2d)>0)
result->setX( (closest-xyz2d).getLength()); // to the right