33 m_btConvexTriangleCallback(ci.m_dispatcher1, body0Wrap, body1Wrap, isSwapped),
34 m_isSwapped(isSwapped)
77 BT_PROFILE(
"btConvexTriangleCallback::processTriangle");
106#ifndef BT_DISABLE_CONVEX_CONCAVE_EARLY_OUT
114 btVector3 triangle_normal_world = ( v1 - v0).cross(v2 - v0);
122 btScalar proj_distPt = triangle_normal_world.
dot(worldPt);
123 btScalar proj_distTr = triangle_normal_world.
dot(v0);
125 btScalar dist = proj_distTr - proj_distPt;
126 if (dist > contact_threshold)
130 triangle_normal_world*=-1;
135 proj_distPt = triangle_normal_world.
dot(worldPt);
136 proj_distTr = triangle_normal_world.
dot(v0);
138 dist = proj_distTr - proj_distPt;
139 if (dist > contact_threshold)
209 btVector3 extra(extraMargin, extraMargin, extraMargin);
222 BT_PROFILE(
"btConvexConcaveCollisionAlgorithm::processCollision");
255 if (queryVertices.
size())
261 for (
int v = 0; v < queryVertices.
size(); v++)
269 if (sdfShape->
queryPoint(vtxInSdf, dist, normalLocal))
280 vtxWorldSpace -= sphere->
getRadius() * normal;
282 resultOut->
addContactPoint(normal, vtxWorldSpace - normal * dist, dist);
325 if (squareMot0 < convexbody->getCcdSquareMotionThreshold())
348 : m_ccdSphereFromTrans(from),
349 m_ccdSphereToTrans(to),
350 m_ccdSphereRadius(ccdSphereRadius),
351 m_hitFraction(hitFraction)
355 virtual void processTriangle(
btVector3* triangle,
int partId,
int triangleIndex)
374 ident, ident, castResult))
389 rayAabbMin -=
btVector3(ccdRadius0, ccdRadius0, ccdRadius0);
390 rayAabbMax +=
btVector3(ccdRadius0, ccdRadius0, ccdRadius0);
393 LocalTriangleSphereCastCallback raycastCallback(convexFromLocal, convexToLocal,
410 return raycastCallback.m_hitFraction;
bool TestTriangleAgainstAabb2(const btVector3 *vertices, const btVector3 &aabbMin, const btVector3 &aabbMax)
conservative test for overlap between triangle and aabb
@ BT_CLOSEST_POINT_ALGORITHMS
@ BT_CONTACT_POINT_ALGORITHMS
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
This class is not enabled yet (work-in-progress) to more aggressively activate objects.
int size() const
return the number of elements in the array
void push_back(const T &_Val)
btCollisionAlgorithm is an collision interface that is compatible with the Broadphase and btDispatche...
virtual void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)=0
virtual ~btCollisionAlgorithm()
btCollisionObject can be used to manage collision detection objects.
btScalar getHitFraction() const
btTransform & getWorldTransform()
const btTransform & getInterpolationWorldTransform() const
const btCollisionShape * getCollisionShape() const
void setHitFraction(btScalar hitFraction)
btScalar getCcdSweptSphereRadius() const
Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm::
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
virtual void getAabb(const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const =0
getAabb returns the axis aligned bounding box in the coordinate frame of the given transform t.
bool isPolyhedral() const
The btConcaveShape class provides an interface for non-moving (static) concave shapes.
virtual btScalar getMargin() const
virtual void processAllTriangles(btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const =0
btConvexConcaveCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, bool isSwapped)
virtual ~btConvexConcaveCollisionAlgorithm()
btScalar calculateTimeOfImpact(btCollisionObject *body0, btCollisionObject *body1, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
btConvexTriangleCallback m_btConvexTriangleCallback
virtual void getAllContactManifolds(btManifoldArray &manifoldArray)
virtual void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
virtual void setMargin(btScalar margin)
The btConvexShape is an abstract shape interface, implemented by all convex shapes such as btBoxShape...
virtual btVector3 localGetSupportingVertex(const btVector3 &vec) const =0
const btVector3 & getAabbMax() const
virtual ~btConvexTriangleCallback()
btScalar m_collisionMarginTriangle
const btVector3 & getAabbMin() const
btDispatcher * m_dispatcher
btConvexTriangleCallback(btDispatcher *dispatcher, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, bool isSwapped)
virtual void processTriangle(btVector3 *triangle, int partId, int triangleIndex)
void setTimeStepAndCounters(btScalar collisionMarginTriangle, const btDispatcherInfo &dispatchInfo, const btCollisionObjectWrapper *convexBodyWrap, const btCollisionObjectWrapper *triBodyWrap, btManifoldResult *resultOut)
btManifoldResult * m_resultOut
const btDispatcherInfo * m_dispatchInfoPtr
btPersistentManifold * m_manifoldPtr
const btCollisionObjectWrapper * m_convexBodyWrap
const btCollisionObjectWrapper * m_triBodyWrap
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
virtual void clearManifold(btPersistentManifold *manifold)=0
virtual void releaseManifold(btPersistentManifold *manifold)=0
virtual void freeCollisionAlgorithm(void *ptr)=0
virtual btCollisionAlgorithm * findAlgorithm(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, btPersistentManifold *sharedManifold, ebtDispatcherQueryType queryType)=0
virtual btPersistentManifold * getNewManifold(const btCollisionObject *b0, const btCollisionObject *b1)=0
virtual void drawLine(const btVector3 &from, const btVector3 &to, const btVector3 &color)=0
virtual int getDebugMode() const =0
btManifoldResult is a helper class to manage contact results.
virtual void setShapeIdentifiersA(int partId0, int index0)
setShapeIdentifiersA/B provides experimental support for per-triangle material / custom material comb...
void setBody0Wrap(const btCollisionObjectWrapper *obj0Wrap)
const btCollisionObjectWrapper * getBody1Wrap() const
void setBody1Wrap(const btCollisionObjectWrapper *obj1Wrap)
void setPersistentManifold(btPersistentManifold *manifoldPtr)
const btCollisionObject * getBody0Internal() const
virtual void setShapeIdentifiersB(int partId1, int index1)
btScalar m_closestPointDistanceThreshold
void refreshContactPoints()
const btCollisionObjectWrapper * getBody0Wrap() const
virtual void addContactPoint(const btVector3 &normalOnBInWorld, const btVector3 &pointInWorld, btScalar depth)
btMatrix3x3 inverse() const
Return the inverse of the matrix.
void setBodies(const btCollisionObject *body0, const btCollisionObject *body1)
btScalar getContactBreakingThreshold() const
The btPolyhedralConvexShape is an internal interface class for polyhedral convex shapes.
virtual void getVertex(int i, btVector3 &vtx) const =0
virtual int getNumVertices() const =0
bool queryPoint(const btVector3 &ptInSDF, btScalar &distOut, btVector3 &normal)
The btSphereShape implements an implicit sphere, centered around a local origin with radius.
btScalar getRadius() const
btSubsimplexConvexCast implements Gino van den Bergens' paper "Ray Casting against bteral Convex Obje...
virtual bool calcTimeOfImpact(const btTransform &fromA, const btTransform &toA, const btTransform &fromB, const btTransform &toB, CastResult &result)
SimsimplexConvexCast calculateTimeOfImpact calculates the time of impact+normal for the linear cast (...
The btTriangleCallback provides a callback for each overlapping triangle when calling processAllTrian...
btVector3 can be used to represent 3D points and vectors.
void setMax(const btVector3 &other)
Set each element to the max of the current values and the values of another btVector3.
btVector3 & safeNormalize()
btScalar dot(const btVector3 &v) const
Return the dot product.
void setMin(const btVector3 &other)
Set each element to the min of the current values and the values of another btVector3.
btVector3 & normalize()
Normalize this vector x^2 + y^2 + z^2 = 1.
btVoronoiSimplexSolver is an implementation of the closest point distance algorithm from a 1-4 points...
btDispatcher * m_dispatcher1
const btCollisionShape * getCollisionShape() const
const btCollisionObject * getCollisionObject() const
const btTransform & getWorldTransform() const
RayResult stores the closest result alternatively, add a callback method to decide about closest/all ...
class btIDebugDraw * m_debugDraw