27 : m_simplexSolver(simplexSolver),
28 m_penetrationDepthSolver(penetrationDepthSolver),
37 m_penetrationDepthSolver(0),
46#define MAX_ITERATIONS 64
70 convexInPlaneTrans = transB.
inverse() * convexWorldTransform;
72 planeInConvex = convexWorldTransform.
inverse() * transB;
76 btVector3 vtxInPlane = convexInPlaneTrans(vtx);
77 btScalar distance = (planeNormal.
dot(vtxInPlane) - planeConstant);
79 btVector3 vtxInPlaneProjected = vtxInPlane - distance * planeNormal;
80 btVector3 vtxInPlaneWorld = transB * vtxInPlaneProjected;
98 btVector3 linVelA, angVelA, linVelB, angVelB;
105 btScalar maxAngularProjectedVelocity = angVelA.
length() * boundingRadiusA + angVelB.
length() * boundingRadiusB;
106 btVector3 relLinVel = (linVelB - linVelA);
110 if ((relLinVelocLength + maxAngularProjectedVelocity) == 0.f)
117 bool hasResult =
false;
143 btScalar projectedLinearVelocity = relLinVel.
dot(n);
144 if ((projectedLinearVelocity + maxAngularProjectedVelocity) <=
SIMD_EPSILON)
148 while (dist > radius)
156 projectedLinearVelocity = relLinVel.
dot(n);
159 if ((projectedLinearVelocity + maxAngularProjectedVelocity) <=
SIMD_EPSILON)
162 dLambda = dist / (projectedLinearVelocity + maxAngularProjectedVelocity);
170 if (lambda <= lastLambda)
179 btTransform interpolatedTransA, interpolatedTransB, relativeTrans;
183 relativeTrans = interpolatedTransB.
inverseTimes(interpolatedTransA);
#define MAX_ITERATIONS
This maximum should not be necessary.
btScalar length(const btQuaternion &q)
Return the length of a quaternion.
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
#define btSimplexSolverInterface
virtual btScalar getAngularMotionDisc() const
getAngularMotionDisc returns the maximum radius needed for Conservative Advancement to handle time-of...
btContinuousConvexCollision(const btConvexShape *shapeA, const btConvexShape *shapeB, btSimplexSolverInterface *simplexSolver, btConvexPenetrationDepthSolver *penetrationDepthSolver)
void computeClosestPoints(const btTransform &transA, const btTransform &transB, struct btPointCollector &pointCollector)
const btStaticPlaneShape * m_planeShape
btConvexPenetrationDepthSolver * m_penetrationDepthSolver
const btConvexShape * m_convexA
btSimplexSolverInterface * m_simplexSolver
const btConvexShape * m_convexB1
virtual bool calcTimeOfImpact(const btTransform &fromA, const btTransform &toA, const btTransform &fromB, const btTransform &toB, CastResult &result)
cast a convex against another convex object
ConvexPenetrationDepthSolver provides an interface for penetration depth calculation.
The btConvexShape is an abstract shape interface, implemented by all convex shapes such as btBoxShape...
virtual btVector3 localGetSupportingVertex(const btVector3 &vec) const =0
virtual btScalar getMargin() const =0
btGjkPairDetector uses GJK to implement the btDiscreteCollisionDetectorInterface
virtual void getClosestPoints(const ClosestPointInput &input, Result &output, class btIDebugDraw *debugDraw, bool swapResults=false)
virtual void drawSphere(btScalar radius, const btTransform &transform, const btVector3 &color)
The btStaticPlaneShape simulates an infinite non-moving (static) collision plane.
const btScalar & getPlaneConstant() const
const btVector3 & getPlaneNormal() const
btVector3 can be used to represent 3D points and vectors.
btScalar length() const
Return the length of the vector.
btScalar dot(const btVector3 &v) const
Return the dot product.
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
RayResult stores the closest result alternatively, add a callback method to decide about closest/all ...
btIDebugDraw * m_debugDrawer
virtual void reportFailure(int errNo, int numIterations)
btScalar m_allowedPenetration
virtual void DebugDraw(btScalar fraction)
btVector3 m_normalOnBInWorld
virtual void addContactPoint(const btVector3 &normalOnBInWorld, const btVector3 &pointInWorld, btScalar depth)