Bullet Collision Detection & Physics Library
|
Go to the documentation of this file.
33 #define BT_SOFTBODY_TRIANGLE_EXTRUSION btScalar(0.06) //make this configurable
37 m_isSwapped(isSwapped),
38 m_btSoftBodyTriangleCallback(ci.m_dispatcher1, body0Wrap, body1Wrap, isSwapped)
129 btVector3 normal = (triangle[1] - triangle[0]).cross(triangle[2] - triangle[0]);
134 btVector3 pts[6] = {triangle[0] + normal,
135 triangle[1] + normal,
136 triangle[2] + normal,
137 triangle[0] - normal,
138 triangle[1] - normal,
139 triangle[2] - normal};
172 btVector3 aabbWorldSpaceMin, aabbWorldSpaceMax;
175 btVector3 softBodyCenter = (aabbWorldSpaceMax + aabbWorldSpaceMin) *
btScalar(0.5);
227 if (squareMot0 < convexbody->getCcdSquareMotionThreshold())
250 : m_ccdSphereFromTrans(from),
251 m_ccdSphereToTrans(to),
252 m_ccdSphereRadius(ccdSphereRadius),
253 m_hitFraction(hitFraction)
257 virtual void processTriangle(
btVector3* triangle,
int partId,
int triangleIndex)
275 ident, ident, castResult))
290 rayAabbMin -=
btVector3(ccdRadius0, ccdRadius0, ccdRadius0);
291 rayAabbMax +=
btVector3(ccdRadius0, ccdRadius0, ccdRadius0);
294 LocalTriangleSphereCastCallback raycastCallback(convexFromLocal, convexToLocal,
311 return raycastCallback.m_hitFraction;
const btCollisionObject * m_triBody
btCollisionObject can be used to manage collision detection objects.
virtual void processTriangle(btVector3 *triangle, int partId, int triangleIndex)
virtual void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
void * getUserPointer() const
virtual ~btCollisionAlgorithm()
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
The btConcaveShape class provides an interface for non-moving (static) concave shapes.
const Value * getAtIndex(int index) const
btSoftBodyConcaveCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, bool isSwapped)
const btDispatcherInfo * m_dispatchInfoPtr
virtual int getDebugMode() const =0
class btIDebugDraw * m_debugDraw
const btTransform & getWorldTransform() const
void setHitFraction(btScalar hitFraction)
btSoftBodyTriangleCallback(btDispatcher *dispatcher, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, bool isSwapped)
virtual void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)=0
btSubsimplexConvexCast implements Gino van den Bergens' paper "Ray Casting against bteral Convex Obje...
virtual void freeCollisionAlgorithm(void *ptr)=0
btCollisionAlgorithm is an collision interface that is compatible with the Broadphase and btDispatche...
btTransform & getWorldTransform()
RayResult stores the closest result alternatively, add a callback method to decide about closest/all ...
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
btVoronoiSimplexSolver is an implementation of the closest point distance algorithm from a 1-4 points...
btHashMap< btHashKey< btTriIndex >, btTriIndex > m_shapeCache
btManifoldResult is a helper class to manage contact results.
int RemoveReferences(btCollisionShape *pcs)
btSoftBodyWorldInfo * getWorldInfo()
const btCollisionShape * getCollisionShape() const
void setMax(const btVector3 &other)
Set each element to the max of the current values and the values of another btVector3.
virtual ~btSoftBodyTriangleCallback()
void setTimeStepAndCounters(btScalar collisionMarginTriangle, const btCollisionObjectWrapper *triObjWrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
const btTransform & getInterpolationWorldTransform() const
The btTriangleCallback provides a callback for each overlapping triangle when calling processAllTrian...
virtual void processAllTriangles(btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const =0
const btCollisionObject * getCollisionObject() const
The btSphereShape implements an implicit sphere, centered around a local origin with radius.
btVector3 can be used to represent 3D points and vectors.
virtual ~btSoftBodyConcaveCollisionAlgorithm()
btDispatcher * m_dispatcher
virtual void getAabb(btVector3 &aabbMin, btVector3 &aabbMax) const
virtual btCollisionAlgorithm * findAlgorithm(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, btPersistentManifold *sharedManifold, ebtDispatcherQueryType queryType)=0
btDispatcher * m_dispatcher1
virtual void drawLine(const btVector3 &from, const btVector3 &to, const btVector3 &color)=0
void setMin(const btVector3 &other)
Set each element to the min of the current values and the values of another btVector3.
The btConvexHullShape implements an implicit convex hull of an array of vertices.
The btSoftBody is an class to simulate cloth and volumetric soft bodies.
void btTransformAabb(const btVector3 &halfExtents, btScalar margin, const btTransform &t, btVector3 &aabbMinOut, btVector3 &aabbMaxOut)
btSoftBodyTriangleCallback m_btSoftBodyTriangleCallback
const btVector3 & getAabbMin() const
btScalar getHitFraction() const
void insert(const Key &key, const Value &value)
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 (...
class btCollisionShape * m_childShape
void setUserPointer(void *userPtr)
optional user data pointer
virtual btScalar getMargin() const
btScalar getCcdSweptSphereRadius() const
Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm::
const btVector3 & getAabbMax() const
btSparseSdf< 3 > m_sparsesdf
btVector3 & normalize()
Normalize this vector x^2 + y^2 + z^2 = 1.
#define BT_SOFTBODY_TRIANGLE_EXTRUSION
btManifoldResult * m_resultOut
btScalar m_closestPointDistanceThreshold
btScalar calculateTimeOfImpact(btCollisionObject *body0, btCollisionObject *body1, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
const btCollisionShape * getCollisionShape() const
btScalar m_collisionMarginTriangle