Removed unused function.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10872 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk
2012-02-17 11:53:29 +00:00
parent c7581353be
commit 1698d1dfe5
2 changed files with 0 additions and 61 deletions

View File

@@ -211,61 +211,6 @@ bool Physics::projectKartDownwards(const Kart *k)
/*allow translation*/true);
} //projectKartsDownwards
//-----------------------------------------------------------------------------
/** Determines the side (left, front, ...) of a rigid body with a box
* collision shape that has a given contact point.
* \param body The rigid body (box shape).
* \param contact_point The contact point (in local coordinates) of the
* contact point.
*/
Physics::CollisionSide Physics::getCollisionSide(const btRigidBody *body,
const Vec3 &contact_point)
{
if(contact_point.getX()>0)
return COL_RIGHT;
else
return COL_LEFT;
btVector3 aabb_min, aabb_max;
static btTransform zero_trans(btQuaternion(0, 0, 0));
body->getCollisionShape()->getAabb(zero_trans, aabb_min, aabb_max);
btVector3 extend = 0.5f*(aabb_max - aabb_min);
CollisionSide result = COL_LEFT;
if(contact_point.getX()>0) // --> right side
{
if(contact_point.getZ()>0) // --> front or right side
{
result = fabsf(extend.getX() - contact_point.getX()) <
fabsf(extend.getZ() - contact_point.getZ()) ? COL_RIGHT
: COL_FRONT;
}
else // getZ()<0 --> back or right side
{
result = fabsf( extend.getX() - contact_point.getX()) <
fabsf( extend.getZ() + contact_point.getZ()) ? COL_RIGHT
: COL_BACK;
}
}
else // getX() < 0 --> left side
{
if(contact_point.getZ()>0) // --> front or left side
{
result = fabsf(extend.getX() + contact_point.getX()) <
fabsf(extend.getZ() - contact_point.getZ()) ? COL_LEFT
: COL_FRONT;
}
else // --> back or left side
{
result = fabsf(extend.getX() + contact_point.getX()) <
fabsf(extend.getZ() + contact_point.getZ()) ? COL_LEFT
: COL_BACK;
}
}
return result;
} // getCollisionSide
//-----------------------------------------------------------------------------
/** Handles the special case of two karts colliding with each other, which
* means that bombs must be passed on. If both karts have a bomb, they'll

View File

@@ -43,12 +43,6 @@ class Vec3;
class Physics : public btSequentialImpulseConstraintSolver
{
private:
/** Which side of a rigid body has a collision. */
enum CollisionSide {COL_LEFT, COL_FRONT, COL_RIGHT, COL_BACK};
CollisionSide getCollisionSide(const btRigidBody *body,
const Vec3 &contact_point);
/** Bullet can report the same collision more than once (up to 4
* contact points per collision. Additionally, more than one internal
* substep might be taken, resulting in potentially even more