30 m_isSwapped(isSwapped),
31 m_numPerturbationIterations(numPerturbationIterations),
32 m_minimumPointsPerturbationThreshold(minimumPointsPerturbationThreshold)
39 m_manifoldPtr = m_dispatcher->getNewManifold(convexObjWrap->getCollisionObject(), planeObjWrap->getCollisionObject());
61 bool hasCollision =
false;
62 const btVector3& planeNormal = planeShape->getPlaneNormal();
63 const btScalar& planeConstant = planeShape->getPlaneConstant();
67 convexInPlaneTrans = planeObjWrap->
getWorldTransform().inverse() * convexWorldTransform;
69 convexWorldTransform.getBasis() *=
btMatrix3x3(perturbeRot);
71 planeInConvex = convexWorldTransform.inverse() * planeObjWrap->
getWorldTransform();
73 btVector3 vtx = convexShape->localGetSupportingVertex(planeInConvex.getBasis() * -planeNormal);
75 btVector3 vtxInPlane = convexInPlaneTrans(vtx);
81 hasCollision =
distance < m_manifoldPtr->getContactBreakingThreshold();
104 bool hasCollision =
false;
105 const btVector3& planeNormal = planeShape->getPlaneNormal();
106 const btScalar& planeConstant = planeShape->getPlaneConstant();
112 btVector3 vtx = convexShape->localGetSupportingVertex(planeInConvex.getBasis() * -planeNormal);
113 btVector3 vtxInPlane = convexInPlaneTrans(vtx);
132 if (convexShape->isPolyhedral() && resultOut->
getPersistentManifold()->getNumContacts() < m_minimumPointsPerturbationThreshold)
140 btScalar radius = convexShape->getAngularMotionDisc();
142 if (perturbeAngle > angleLimit)
143 perturbeAngle = angleLimit;
146 for (
int i = 0;
i < m_numPerturbationIterations;
i++)
150 collideSingleContact(rotq.inverse() * perturbeRot * rotq, body0Wrap, body1Wrap, dispatchInfo, resultOut);
156 if (m_manifoldPtr->getNumContacts())
btScalar gContactBreakingThreshold
btConvexShape()
not supported on IBM SDK, until we fix the alignment of btVector3
btMatrix3x3
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with...
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btStaticPlaneShape(const btVector3 &planeNormal, btScalar planeConstant)
SIMD_FORCE_INLINE void btPlaneSpace1(const T &n, T &p, T &q)
btVector3
btVector3 can be used to represent 3D points and vectors. It has an un-used w component to suit 16-by...
btDispatcher * m_dispatcher
virtual ~btConvexPlaneCollisionAlgorithm()
btConvexPlaneCollisionAlgorithm(btPersistentManifold *mf, const btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, bool isSwapped, int numPerturbationIterations, int minimumPointsPerturbationThreshold)
void collideSingleContact(const btQuaternion &perturbeRot, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
virtual void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
virtual btScalar calculateTimeOfImpact(btCollisionObject *body0, btCollisionObject *body1, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
btManifoldResult is a helper class to manage contact results.
const btPersistentManifold * getPersistentManifold() const
void setPersistentManifold(btPersistentManifold *manifoldPtr)
btScalar m_closestPointDistanceThreshold
SIMD_FORCE_INLINE void refreshContactPoints()
virtual void addContactPoint(const btVector3 &normalOnBInWorld, const btVector3 &pointInWorld, btScalar depth)
The btQuaternion implements quaternion to perform linear algebra rotations in combination with btMatr...
float distance(VecOp< float, D >, VecOp< float, D >) RET
SIMD_FORCE_INLINE const btCollisionShape * getCollisionShape() const
SIMD_FORCE_INLINE const btTransform & getWorldTransform() const
SIMD_FORCE_INLINE const btCollisionObject * getCollisionObject() const