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