44 m_deformableBodySolver(deformableBodySolver),
80 (*m_internalPreTickCallback)(
this, timeStep);
165 BT_PROFILE(
"btDeformableMultiBodyDynamicsWorld::applyRepulsionForce");
178 BT_PROFILE(
"btDeformableMultiBodyDynamicsWorld::performGeometricCollisions");
234 int penetration_count = 0;
244 if (penetration_count == 0)
263 BT_PROFILE(
"btDeformableMultiBodyDynamicsWorld::softBodySelfCollision");
286 if (pushVelocity[0] != 0.f || pushVelocity[1] != 0 || pushVelocity[2] != 0 || turnVelocity[0] != 0.f || turnVelocity[1] != 0 || turnVelocity[2] != 0)
306 BT_PROFILE(
"btDeformableMultiBodyDynamicsWorld::solveConstraints");
383 bool isSleeping =
false;
408 bool isConstraintPass =
true;
435 collisionFilterGroup,
436 collisionFilterMask);
513 bool isSleeping =
false;
530 bool isConstraintPass =
false;
541 btAssert(
" RK4Integration is not supported");
568 bool isSleeping =
false;
596 (*m_internalTickCallback)(
this, timeStep);
617 for (
int i = 0; i < forces.
size(); ++i)
621 forces[i]->addSoftBody(psb);
637 int removed_index = -1;
638 for (
int i = 0; i < forces.
size(); ++i)
642 forces[i]->removeSoftBody(psb);
648 if (removed_index >= 0)
655 for (
int i = 0; i < forces.
size(); ++i)
657 forces[i]->removeSoftBody(psb);
683 int numSimulationSubSteps = 0;
692 numSimulationSubSteps = int(
m_localTime / fixedTimeStep);
693 m_localTime -= numSimulationSubSteps * fixedTimeStep;
699 fixedTimeStep = timeStep;
704 numSimulationSubSteps = 0;
709 numSimulationSubSteps = 1;
720 if (numSimulationSubSteps)
723 int clampedSimulationSteps = (numSimulationSubSteps > maxSubSteps) ? maxSubSteps : numSimulationSubSteps;
727 for (
int i = 0; i < clampedSimulationSteps; i++)
741 CProfileManager::Increment_Frame_Counter();
744 return numSimulationSubSteps;
#define DISABLE_DEACTIVATION
#define WANTS_DEACTIVATION
bool gDisableDeactivation
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
bool btFuzzyZero(btScalar x)
int size() const
return the number of elements in the array
void resize(int newsize, const T &fillData=T())
void removeAtIndex(int index)
void remove(const T &key)
void quickSort(const L &CompareFunc)
void push_back(const T &_Val)
The btBroadphaseInterface class provides an interface to detect aabb-overlapping object pairs.
btCollisionConfiguration allows to configure Bullet collision detection stack allocator size,...
btCollisionObject can be used to manage collision detection objects.
btTransform & getWorldTransform()
void setActivationState(int newState) const
void setWorldTransform(const btTransform &worldTrans)
int getActivationState() const
btDispatcher * getDispatcher()
btDispatcherInfo & getDispatchInfo()
virtual btIDebugDraw * getDebugDrawer()
virtual void removeCollisionObject(btCollisionObject *collisionObject)
virtual void addCollisionObject(btCollisionObject *collisionObject, int collisionFilterGroup=btBroadphaseProxy::DefaultFilter, int collisionFilterMask=btBroadphaseProxy::AllFilter)
virtual void performDiscreteCollisionDetection()
btIDebugDraw * m_debugDrawer
virtual void allSolved(const btContactSolverInfo &, class btIDebugDraw *)
virtual void solveDeformableConstraints(btScalar solverdt)
virtual void setConstraints(const btContactSolverInfo &infoGlobal)
virtual void applyTransforms(btScalar timeStep)
virtual void setStrainLimiting(bool opt)
virtual void setPreconditioner(int opt)
virtual void setProjection()
virtual btAlignedObjectArray< btDeformableLagrangianForce * > * getLagrangianForceArray()
virtual void reinitialize(const btAlignedObjectArray< btSoftBody * > &softBodies, btScalar dt)
virtual void setupDeformableSolve(bool implicit)
void setLineSearch(bool lineSearch)
virtual const btAlignedObjectArray< btSoftBody::Node * > * getIndices()
virtual void predictMotion(btScalar solverdt)
Predict motion of soft bodies into next timestep.
void setImplicit(bool implicit)
virtual void setLagrangeMultiplier()
virtual void setGravity(const btVector3 &gravity)
void applyRigidBodyGravity(btScalar timeStep)
btDeformableMultiBodyDynamicsWorld(btDispatcher *dispatcher, btBroadphaseInterface *pairCache, btDeformableMultiBodyConstraintSolver *constraintSolver, btCollisionConfiguration *collisionConfiguration, btDeformableBodySolver *deformableBodySolver=0)
void removeCollisionObject(btCollisionObject *collisionObject)
removeCollisionObject will first check if it is a rigid body, if so call removeRigidBody otherwise ca...
virtual void addSoftBody(btSoftBody *body, int collisionFilterGroup=btBroadphaseProxy::DefaultFilter, int collisionFilterMask=btBroadphaseProxy::AllFilter)
void removeSoftBodyForce(btSoftBody *psb)
void removeSoftBody(btSoftBody *body)
void reinitialize(btScalar timeStep)
void positionCorrection(btScalar timeStep)
virtual void predictUnconstraintMotion(btScalar timeStep)
void afterSolverCallbacks(btScalar timeStep)
void applyRepulsionForce(btScalar timeStep)
virtual void debugDrawWorld()
void solveConstraints(btScalar timeStep)
void addForce(btSoftBody *psb, btDeformableLagrangianForce *force)
void softBodySelfCollision()
btSolverCallback m_solverCallback
void performGeometricCollisions(btScalar timeStep)
virtual void integrateTransforms(btScalar timeStep)
void removeForce(btSoftBody *psb, btDeformableLagrangianForce *force)
btSoftBodyWorldInfo m_sbi
virtual void internalSingleStepSimulation(btScalar timeStep)
void updateActivationState(btScalar timeStep)
virtual ~btDeformableMultiBodyDynamicsWorld()
void solveContactConstraints()
virtual int stepSimulation(btScalar timeStep, int maxSubSteps=1, btScalar fixedTimeStep=btScalar(1.)/btScalar(60.))
if maxSubSteps > 0, it will interpolate motion between fixedTimeStep's
btSoftBodyArray m_softBodies
DeformableBodyInplaceSolverIslandCallback * m_solverDeformableBodyIslandCallback
virtual void setGravity(const btVector3 &gravity)
btSoftBodyArray & getSoftBodyArray()
void beforeSolverCallbacks(btScalar timeStep)
void performDeformableCollisionDetection()
btDeformableBodySolver * m_deformableBodySolver
Solver classes that encapsulate multiple deformable bodies for solving.
void updateActions(btScalar timeStep)
virtual void setGravity(const btVector3 &gravity)
bool m_latencyMotionStateInterpolation
btAlignedObjectArray< btTypedConstraint * > m_sortedConstraints
virtual void synchronizeMotionStates()
btSimulationIslandManager * m_islandManager
btAlignedObjectArray< btTypedConstraint * > m_constraints
btAlignedObjectArray< btRigidBody * > m_nonStaticRigidBodies
virtual int getNumConstraints() const
virtual void removeCollisionObject(btCollisionObject *collisionObject)
removeCollisionObject will first check if it is a rigid body, if so call removeRigidBody otherwise ca...
btConstraintSolver * m_constraintSolver
btCollisionWorld * getCollisionWorld()
void startProfiling(btScalar timeStep)
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
btContactSolverInfo m_solverInfo
btContactSolverInfo & getSolverInfo()
btInternalTickCallback m_internalTickCallback
btInternalTickCallback m_internalPreTickCallback
The btIDebugDraw interface class allows hooking up a debug renderer to visually debug simulations.
virtual int getDebugMode() const =0
The btMultiBodyDynamicsWorld adds Featherstone multi body dynamics to Bullet This implementation is s...
btAlignedObjectArray< btMultiBodyConstraint * > m_multiBodyConstraints
virtual void clearForces()
the forces on each rigidbody is accumulating together with gravity. clear this after each timestep.
virtual void updateActivationState(btScalar timeStep)
btAlignedObjectArray< btMatrix3x3 > m_scratch_m
btAlignedObjectArray< btVector3 > m_scratch_v
virtual void predictUnconstraintMotion(btScalar timeStep)
virtual void calculateSimulationIslands()
virtual void integrateTransforms(btScalar timeStep)
btAlignedObjectArray< btMultiBody * > m_multiBodies
btAlignedObjectArray< btScalar > m_scratch_r
btAlignedObjectArray< btMultiBodyConstraint * > m_sortedMultiBodyConstraints
virtual void clearMultiBodyConstraintForces()
virtual void saveKinematicState(btScalar timeStep)
virtual void applyGravity()
apply gravity, call this once per timestep
virtual void debugDrawWorld()
void computeAccelerationsArticulatedBodyAlgorithmMultiDof(btScalar dt, btAlignedObjectArray< btScalar > &scratch_r, btAlignedObjectArray< btVector3 > &scratch_v, btAlignedObjectArray< btMatrix3x3 > &scratch_m, bool isConstraintPass, bool jointFeedbackInWorldSpace, bool jointFeedbackInJointFrame)
const btMultibodyLink & getLink(int index) const
btScalar getLinkMass(int i) const
void addLinkForce(int i, const btVector3 &f)
void processDeltaVeeMultiDof2()
bool isUsingRK4Integration() const
const btMultiBodyLinkCollider * getBaseCollider() const
bool internalNeedsJointFeedback() const
btScalar getBaseMass() const
void addBaseForce(const btVector3 &f)
The btRigidBody is the main class for rigid body objects.
void integrateVelocities(btScalar step)
void setTurnVelocity(const btVector3 &v)
void setPushVelocity(const btVector3 &v)
btVector3 getPushVelocity() const
btVector3 getTurnVelocity() const
void processIslands(btDispatcher *dispatcher, btCollisionWorld *collisionWorld, IslandCallback *callback)
void buildIslands(btDispatcher *dispatcher, btCollisionWorld *colWorld)
The btSoftBody is an class to simulate cloth and volumetric soft bodies.
void defaultCollisionHandler(const btCollisionObjectWrapper *pcoWrap)
btAlignedObjectArray< DeformableFaceNodeContact > m_faceNodeContactsCCD
void setSoftBodySolver(btSoftBodySolver *softBodySolver)
void updateDeactivation(btScalar timeStep)
void applyRepulsionForce(btScalar timeStep, bool applySpringForce)
static const btSoftBody * upcast(const btCollisionObject *colObj)
TypedConstraint is the baseclass for Bullet constraints and vehicles.
btVector3 can be used to represent 3D points and vectors.
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
virtual void processConstraints(int islandId=-1)
virtual void setup(btContactSolverInfo *solverInfo, btTypedConstraint **sortedConstraints, int numConstraints, btMultiBodyConstraint **sortedMultiBodyConstraints, int numMultiBodyConstraints, btIDebugDraw *debugDrawer)
class btIDebugDraw * m_debugDraw
class btMultiBodyLinkCollider * m_collider
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
void setDefaultVoxelsz(btScalar sz)
void Initialize(int hashsize=2383, int clampCells=256 *1024)