32 m_softBodySolver(softBodySolver),
73 BT_PROFILE(
"predictUnconstraintMotionSoftBody");
85 btAssert(
"Solver initialization failed\n");
129 collisionFilterGroup,
130 collisionFilterMask);
197 btVector3 rayDir = (rayToWorld - rayFromWorld);
225#ifdef RECALCULATE_AABB
226 btVector3 collisionObjectAabbMin,collisionObjectAabbMax;
256#ifndef USE_BRUTEFORCE_RAYBROADPHASE
293 if (normal.
dot(rayDir) > 0)
304 bool normalInWorldSpace =
true;
#define btAlignedFree(ptr)
#define btAlignedAlloc(size, alignment)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
int size() const
return the number of elements in the array
void remove(const T &key)
void push_back(const T &_Val)
The btBroadphaseInterface class provides an interface to detect aabb-overlapping object pairs.
virtual void rayTest(const btVector3 &rayFrom, const btVector3 &rayTo, btBroadphaseRayCallback &rayCallback, const btVector3 &aabbMin=btVector3(0, 0, 0), const btVector3 &aabbMax=btVector3(0, 0, 0))=0
btCollisionConfiguration allows to configure Bullet collision detection stack allocator size,...
btCollisionObject can be used to manage collision detection objects.
virtual const char * serialize(void *dataBuffer, class btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
btTransform & getWorldTransform()
btBroadphaseProxy * getBroadphaseHandle()
int getInternalType() const
reserved for Bullet internal usage
virtual int calculateSerializeBufferSize() const
const btCollisionShape * getCollisionShape() const
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.
virtual btIDebugDraw * getDebugDrawer()
btBroadphaseInterface * m_broadphasePairCache
virtual void removeCollisionObject(btCollisionObject *collisionObject)
virtual void addCollisionObject(btCollisionObject *collisionObject, int collisionFilterGroup=btBroadphaseProxy::DefaultFilter, int collisionFilterMask=btBroadphaseProxy::AllFilter)
btAlignedObjectArray< btCollisionObject * > m_collisionObjects
int getNumCollisionObjects() const
btIDebugDraw * m_debugDrawer
static void rayTestSingle(const btTransform &rayFromTrans, const btTransform &rayToTrans, btCollisionObject *collisionObject, const btCollisionShape *collisionShape, const btTransform &colObjWorldTransform, RayResultCallback &resultCallback)
rayTestSingle performs a raycast call and calls the resultCallback.
void serializeCollisionObjects(btSerializer *serializer)
btDiscreteDynamicsWorld provides discrete rigid body simulation those classes replace the obsolete Cc...
void serializeRigidBodies(btSerializer *serializer)
virtual void internalSingleStepSimulation(btScalar timeStep)
void serializeDynamicsWorldInfo(btSerializer *serializer)
virtual void removeCollisionObject(btCollisionObject *collisionObject)
removeCollisionObject will first check if it is a rigid body, if so call removeRigidBody otherwise ca...
virtual void debugDrawWorld()
virtual void predictUnconstraintMotion(btScalar timeStep)
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
virtual int getDebugMode() const =0
virtual btChunk * allocate(size_t size, int numElements)=0
virtual void finishSerialization()=0
virtual void startSerialization()=0
virtual void finalizeChunk(btChunk *chunk, const char *structType, int chunkCode, void *oldPtr)=0
virtual void predictMotion(btScalar solverdt)=0
Predict motion of soft bodies into next timestep.
float getTimeScale()
Return the timescale that the simulation is using.
virtual bool checkInitialized()=0
Ensure that this solver is initialized.
virtual ~btSoftBodySolver()
virtual void updateSoftBodies()=0
Perform necessary per-step updates of soft bodies such as recomputing normals and bounding boxes.
virtual void solveConstraints(btScalar solverdt)=0
Solve constraints for a set of soft bodies.
virtual void optimize(btAlignedObjectArray< btSoftBody * > &softBodies, bool forceUpdate=false)=0
Optimize soft bodies in this solver.
The btSoftBody is an class to simulate cloth and volumetric soft bodies.
void defaultCollisionHandler(const btCollisionObjectWrapper *pcoWrap)
bool rayTest(const btVector3 &rayFrom, const btVector3 &rayTo, sRayCast &results)
Ray casting using rayFrom and rayTo in worldspace, (not direction!)
void setSoftBodySolver(btSoftBodySolver *softBodySolver)
static void solveClusters(const btAlignedObjectArray< btSoftBody * > &bodies)
static const btSoftBody * upcast(const btCollisionObject *colObj)
static void rayTestSingle(const btTransform &rayFromTrans, const btTransform &rayToTrans, btCollisionObject *collisionObject, const btCollisionShape *collisionShape, const btTransform &colObjWorldTransform, RayResultCallback &resultCallback)
rayTestSingle performs a raycast call and calls the resultCallback.
btSoftBodyWorldInfo m_sbi
btSoftBodyArray m_softBodies
void serializeSoftBodies(btSerializer *serializer)
void removeSoftBody(btSoftBody *body)
btSoftBodySolver * m_softBodySolver
Solver classes that encapsulate multiple soft bodies for solving.
virtual void debugDrawWorld()
virtual ~btSoftRigidDynamicsWorld()
btSoftBodyArray & getSoftBodyArray()
void addSoftBody(btSoftBody *body, int collisionFilterGroup=btBroadphaseProxy::DefaultFilter, int collisionFilterMask=btBroadphaseProxy::AllFilter)
virtual void rayTest(const btVector3 &rayFromWorld, const btVector3 &rayToWorld, RayResultCallback &resultCallback) const
rayTest performs a raycast on all objects in the btCollisionWorld, and calls the resultCallback This ...
static void rayTestSingle(const btTransform &rayFromTrans, const btTransform &rayToTrans, btCollisionObject *collisionObject, const btCollisionShape *collisionShape, const btTransform &colObjWorldTransform, RayResultCallback &resultCallback)
rayTestSingle performs a raycast call and calls the resultCallback.
virtual void predictUnconstraintMotion(btScalar timeStep)
virtual void serialize(btSerializer *serializer)
Preliminary serialization test for Bullet 2.76. Loading those files requires a separate parser (see B...
virtual void internalSingleStepSimulation(btScalar timeStep)
btSoftRigidDynamicsWorld(btDispatcher *dispatcher, btBroadphaseInterface *pairCache, btConstraintSolver *constraintSolver, btCollisionConfiguration *collisionConfiguration, btSoftBodySolver *softBodySolver=0)
virtual void removeCollisionObject(btCollisionObject *collisionObject)
removeCollisionObject will first check if it is a rigid body, if so call removeRigidBody otherwise ca...
void solveSoftBodiesConstraints(btScalar timeStep)
btVector3 can be used to represent 3D points and vectors.
btScalar dot(const btVector3 &v) const
Return the dot product.
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
btVector3 & normalize()
Normalize this vector x^2 + y^2 + z^2 = 1.
The btBroadphaseProxy is the main class that can be used with the Bullet broadphases.
btVector3 m_rayDirectionInverse
added some cached data to accelerate ray-AABB tests
LocalShapeInfo gives extra information for complex shapes Currently, only btTriangleMeshShape is avai...
RayResultCallback is used to report new raycast results.
btScalar m_closestHitFraction
virtual bool needsCollision(btBroadphaseProxy *proxy0) const
virtual btScalar addSingleResult(LocalRayResult &rayResult, bool normalInWorldSpace)=0
static void DrawNodeTree(btSoftBody *psb, btIDebugDraw *idraw, int mindepth=0, int maxdepth=-1)
static void DrawFaceTree(btSoftBody *psb, btIDebugDraw *idraw, int mindepth=0, int maxdepth=-1)
static void DrawClusterTree(btSoftBody *psb, btIDebugDraw *idraw, int mindepth=0, int maxdepth=-1)
static void Draw(btSoftBody *psb, btIDebugDraw *idraw, int drawflags=fDrawFlags::Std)
static void DrawFrame(btSoftBody *psb, btIDebugDraw *idraw)
btDispatcher * m_dispatcher
btSparseSdf< 3 > m_sparsesdf
btBroadphaseInterface * m_broadphase
eFeature::_ feature
soft body
btScalar fraction
feature index
btTransform m_rayFromTrans
const btSoftMultiBodyDynamicsWorld * m_world
const btSoftRigidDynamicsWorld * m_world
btCollisionWorld::RayResultCallback & m_resultCallback
virtual bool process(const btBroadphaseProxy *proxy)
btSoftSingleRayCallback(const btVector3 &rayFromWorld, const btVector3 &rayToWorld, const btSoftRigidDynamicsWorld *world, btCollisionWorld::RayResultCallback &resultCallback)
void Initialize(int hashsize=2383, int clampCells=256 *1024)