Removed unused functions.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4998 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
@@ -95,36 +95,3 @@ void QuadSet::load(const std::string &filename) {
|
||||
} // load
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
/** Returns wether a point is to the left or to the right of a line.
|
||||
While all arguments are 3d, only the x and y coordinates are actually used.
|
||||
*/
|
||||
float QuadSet::sideOfLine2D(const Vec3 &l1, const Vec3 &l2, const Vec3 &p) const
|
||||
{
|
||||
return (l2.getX()-l1.getX())*(p.getZ()-l1.getZ()) -
|
||||
(l2.getZ()-l1.getZ())*(p.getX()-l1.getX());
|
||||
} // sideOfLine
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
bool QuadSet::pointInQuad(const Quad& q, const btVector3& p) const {
|
||||
if(sideOfLine2D(q[0], q[2], p)<0) {
|
||||
return sideOfLine2D(q[0], q[1], p) > 0.0 &&
|
||||
sideOfLine2D(q[1], q[2], p) >= 0.0;
|
||||
} else {
|
||||
return sideOfLine2D(q[2], q[3], p) > 0.0 &&
|
||||
sideOfLine2D(q[3], q[0], p) >= 0.0;
|
||||
}
|
||||
} // pointInQuad
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
/** Determines the quad on which the position pos is. This is a rather slow
|
||||
algorithm, used to get the initial quad position of a kart, but not for
|
||||
constantly updating it.
|
||||
*/
|
||||
int QuadSet::getQuadAtPos(const Vec3 &pos) const {
|
||||
for(unsigned int i=0; i<m_all_quads.size(); i++) {
|
||||
if(pointInQuad(*(m_all_quads[i]), pos)) return i;
|
||||
}
|
||||
return QUAD_NONE;
|
||||
} // getQuadAtPos
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
@@ -38,19 +38,13 @@ private:
|
||||
void load (const std::string &filename);
|
||||
void getPoint(const XMLNode *xml, const std::string &attribute_name,
|
||||
Vec3 *result) const;
|
||||
float sideOfLine2D(const Vec3 &l1, const Vec3 &l2, const Vec3 &p) const;
|
||||
|
||||
public:
|
||||
static const int QUAD_NONE=-1;
|
||||
|
||||
QuadSet (const std::string& filename);
|
||||
int getQuadAtPos (const Vec3& p) const;
|
||||
const Quad& getQuad(int n) const {return *(m_all_quads[n]); }
|
||||
int getCurrentQuad(const Vec3& p, int oldQuad) const;
|
||||
bool pointInQuad (const Quad& q, const btVector3& p) const;
|
||||
/** Returns true if the point p is in the n-th. quad. */
|
||||
bool pointInQuad (int n, const btVector3& p) const
|
||||
{return pointInQuad(*m_all_quads[n],p);}
|
||||
/** Return the minimum and maximum coordinates of this quad set. */
|
||||
void getBoundingBox(Vec3 *min, Vec3 *max) { *min=m_min; *max=m_max; }
|
||||
/** Returns the number of quads. */
|
||||
|
||||
Reference in New Issue
Block a user