Removed unnecessary 'offset' added to quad graph. This code could cause the position of the

karts to be incorrect just after crossing the lap line. Problem was that the center point
of the first quad line (which by definition is on the line) would be considered to be not
on the line due to floating point errors (i.e. 0.5*(A+B) would not be on the line between
A and B).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5180 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-04-12 14:23:39 +00:00
parent 2e17db62a8
commit 375e0882ff
2 changed files with 0 additions and 11 deletions

View File

@ -40,7 +40,6 @@ QuadGraph::QuadGraph(const std::string &quad_file_name,
m_mesh = NULL;
m_mesh_buffer = NULL;
m_lap_length = 0;
m_offset_for_startline = 0;
m_all_quads = new QuadSet(quad_file_name);
m_quad_filename = quad_file_name;
GraphNode::m_all_quads = m_all_quads;
@ -79,7 +78,6 @@ void QuadGraph::setStartCoordinate(const CheckLine &cl)
}
Vec3 xyz;
spatialToTrack(&xyz, start_point, sector);
m_offset_for_startline = xyz.getZ();
} // setStartCoordinate
// -----------------------------------------------------------------------------
@ -325,10 +323,6 @@ void QuadGraph::spatialToTrack(Vec3 *dst, const Vec3& xyz,
}
getNode(sector).getDistances(xyz, dst);
float z=dst->getZ();
z=z-m_offset_for_startline;
if(z<0) z+=m_lap_length;
dst->setZ(z);
} // spatialToTrack
//-----------------------------------------------------------------------------

View File

@ -52,11 +52,6 @@ private:
/** Scaling for mini map, only x and y components are used. */
Vec3 m_scaling;
/** This is the track coordinate for the start line. This offset is
* added to the Y value of spatialToTrack. It guarantees that the
* start line is always at track coordinates 0 (for Y). */
float m_offset_for_startline;
/** Stores the filename - just used for error messages. */
std::string m_quad_filename;