| Bullet Collision Detection & Physics Library
    | 
 
 
 
Go to the documentation of this file.
   28           m_isSwapped(isSwapped)
 
   70         if (
getSphereDistance(boxObjWrap, pOnBox, normalOnSurfaceB, penetrationDepth, sphereCenter, radius, maxContactDistance))
 
  101         penetrationDepth = 1.0f;
 
  116         btScalar intersectionDist = fRadius + boxMargin;
 
  117         btScalar contactDist = intersectionDist + maxContactDistance;
 
  118         normal = sphereRelPos - closestPoint;
 
  122         if (dist2 > contactDist * contactDist)
 
  136                 distance = normal.
length();
 
  140         pointOnBox = closestPoint + normal * boxMargin;
 
  142         penetrationDepth = distance - intersectionDist;
 
  160         closestPoint.
setX(boxHalfExtent.
getX());
 
  163         faceDist = boxHalfExtent.
getX() + sphereRelPos.
getX();
 
  164         if (faceDist < minDist)
 
  167                 closestPoint = sphereRelPos;
 
  168                 closestPoint.
setX(-boxHalfExtent.
getX());
 
  172         faceDist = boxHalfExtent.
getY() - sphereRelPos.
getY();
 
  173         if (faceDist < minDist)
 
  176                 closestPoint = sphereRelPos;
 
  177                 closestPoint.
setY(boxHalfExtent.
getY());
 
  181         faceDist = boxHalfExtent.
getY() + sphereRelPos.
getY();
 
  182         if (faceDist < minDist)
 
  185                 closestPoint = sphereRelPos;
 
  186                 closestPoint.
setY(-boxHalfExtent.
getY());
 
  190         faceDist = boxHalfExtent.
getZ() - sphereRelPos.
getZ();
 
  191         if (faceDist < minDist)
 
  194                 closestPoint = sphereRelPos;
 
  195                 closestPoint.
setZ(boxHalfExtent.
getZ());
 
  199         faceDist = boxHalfExtent.
getZ() + sphereRelPos.
getZ();
 
  200         if (faceDist < minDist)
 
  203                 closestPoint = sphereRelPos;
 
  204                 closestPoint.
setZ(-boxHalfExtent.
getZ());
 
  
btCollisionObject can be used to manage collision detection objects.
btPersistentManifold * m_manifoldPtr
btScalar length() const
Return the length of the vector.
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
btDispatcher * m_dispatcher
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
The btBoxShape is a box primitive around the origin, its sides axis aligned with length specified by ...
void setZ(btScalar _z)
Set the z value.
virtual ~btSphereBoxCollisionAlgorithm()
int getNumContacts() const
btSphereBoxCollisionAlgorithm(btPersistentManifold *mf, const btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, bool isSwapped)
const btTransform & getWorldTransform() const
bool getSphereDistance(const btCollisionObjectWrapper *boxObjWrap, btVector3 &v3PointOnBox, btVector3 &normal, btScalar &penetrationDepth, const btVector3 &v3SphereCenter, btScalar fRadius, btScalar maxContactDistance)
btScalar getSpherePenetration(btVector3 const &boxHalfExtent, btVector3 const &sphereRelPos, btVector3 &closestPoint, btVector3 &normal)
const T & btMin(const T &a, const T &b)
const T & btMax(const T &a, const T &b)
virtual btPersistentManifold * getNewManifold(const btCollisionObject *b0, const btCollisionObject *b1)=0
virtual bool needsCollision(const btCollisionObject *body0, const btCollisionObject *body1)=0
const btScalar & getX() const
Return the x value.
virtual void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
void setX(btScalar _x)
Set the x value.
btManifoldResult is a helper class to manage contact results.
virtual void releaseManifold(btPersistentManifold *manifold)=0
const btCollisionShape * getCollisionShape() const
void setY(btScalar _y)
Set the y value.
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.
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
const btVector3 & getHalfExtentsWithoutMargin() const
void setPersistentManifold(btPersistentManifold *manifoldPtr)
virtual btScalar getMargin() const
const btScalar & getZ() const
Return the z value.
const btScalar & getY() const
Return the y value.
void refreshContactPoints()
This class is not enabled yet (work-in-progress) to more aggressively activate objects.
virtual btScalar calculateTimeOfImpact(btCollisionObject *body0, btCollisionObject *body1, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
virtual void addContactPoint(const btVector3 &normalOnBInWorld, const btVector3 &pointInWorld, btScalar depth)
btScalar getContactBreakingThreshold() const
btScalar length2() const
Return the length of the vector squared.
btScalar getRadius() const