31 for (
int iteration = 0; iteration < maxIterations; iteration++)
51#ifdef VERBOSE_RESIDUAL_PRINTF
52 if (iteration >= (maxIterations - 1))
73void btDeformableMultiBodyConstraintSolver::solveDeformableBodyGroup(
btCollisionObject** bodies,
int numBodies,
btCollisionObject** deformableBodies,
int numDeformableBodies,
btPersistentManifold** manifold,
int numManifolds,
btTypedConstraint** constraints,
int numConstraints,
btMultiBodyConstraint** multiBodyConstraints,
int numMultiBodyConstraints,
const btContactSolverInfo& info,
btIDebugDraw* debugDrawer,
btDispatcher* dispatcher)
82 solveDeformableGroupIterations(bodies, numBodies, deformableBodies, numDeformableBodies, manifold, numManifolds, constraints, numConstraints, info, debugDrawer);
99 for (
int i = 0; i < numBodies; i++)
142 for (
int i = 0; i < numDeformableBodies; ++i)
181 BT_PROFILE(
"solveGroupCacheFriendlySplitImpulseIterations");
186 for (iteration = 0; iteration < infoGlobal.
m_numIterations; iteration++)
188 btScalar leastSquaresResidual = 0.f;
192 for (j = 0; j < numPoolConstraints; j++)
197 leastSquaresResidual =
btMax(leastSquaresResidual, residual * residual);
202 leastSquaresResidual =
btMax(leastSquaresResidual, residual * residual);
204 if (leastSquaresResidual <= infoGlobal.m_leastSquaresResidualThreshold || iteration >= (infoGlobal.
m_numIterations - 1))
206#ifdef VERBOSE_RESIDUAL_PRINTF
208 printf(
"split impulse residual = %f at iteration #%d\n", leastSquaresResidual, iteration);
const T & btMax(const T &a, const T &b)
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
btCollisionObject can be used to manage collision detection objects.
bool isStaticObject() const
int getCompanionId() const
btDeformableBackwardEulerObjective * m_objective
virtual bool isReducedSolver()
virtual btScalar solveContactConstraints(btCollisionObject **deformableBodies, int numDeformableBodies, const btContactSolverInfo &infoGlobal)
virtual void deformableBodyInternalWriteBack()
void writeToSolverBody(btCollisionObject **bodies, int numBodies, const btContactSolverInfo &infoGlobal)
btDeformableBodySolver * m_deformableSolver
void pairDeformableAndSolverBody(btCollisionObject **bodies, int numBodies, int numDeformableBodies, const btContactSolverInfo &infoGlobal)
virtual void solveDeformableBodyGroup(btCollisionObject **bodies, int numBodies, btCollisionObject **deformableBodies, int numDeformableBodies, btPersistentManifold **manifold, int numManifolds, btTypedConstraint **constraints, int numConstraints, btMultiBodyConstraint **multiBodyConstraints, int numMultiBodyConstraints, const btContactSolverInfo &info, btIDebugDraw *debugDrawer, btDispatcher *dispatcher)
virtual void solveGroupCacheFriendlySplitImpulseIterations(btCollisionObject **bodies, int numBodies, btCollisionObject **deformableBodies, int numDeformableBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer)
virtual btScalar solveDeformableGroupIterations(btCollisionObject **bodies, int numBodies, btCollisionObject **deformableBodies, int numDeformableBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer)
void solverBodyWriteBack(const btContactSolverInfo &infoGlobal)
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
The btIDebugDraw interface class allows hooking up a debug renderer to visually debug simulations.
btMultiBodyConstraint ** m_tmpMultiBodyConstraints
int m_tmpNumMultiBodyConstraints
virtual btScalar solveGroupCacheFriendlyFinish(btCollisionObject **bodies, int numBodies, const btContactSolverInfo &infoGlobal)
virtual btScalar solveGroupCacheFriendlySetup(btCollisionObject **bodies, int numBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer)
virtual btScalar solveSingleIteration(int iteration, btCollisionObject **bodies, int numBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer)
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
btAlignedObjectArray< btAlignedObjectArray< btReducedDeformableNodeRigidContactConstraint > > m_nodeRigidConstraints
The btRigidBody is the main class for rigid body objects.
btScalar getInvMass() const
const btVector3 & getAngularVelocity() const
static const btRigidBody * upcast(const btCollisionObject *colObj)
to keep collision detection and dynamics separate we don't store a rigidbody pointer but a rigidbody ...
const btVector3 & getLinearVelocity() const
btConstraintArray m_tmpSolverContactConstraintPool
int m_maxOverrideNumSolverIterations
btSolverAnalyticsData m_analyticsData
btScalar m_leastSquaresResidual
btAlignedObjectArray< btSolverBody > m_tmpSolverBodyPool
btAlignedObjectArray< int > m_orderTmpConstraintPool
int getOrInitSolverBody(btCollisionObject &body, btScalar timeStep)
btScalar resolveSplitPenetrationImpulse(btSolverBody &bodyA, btSolverBody &bodyB, const btSolverConstraint &contactConstraint)
TypedConstraint is the baseclass for Bullet constraints and vehicles.
const btCollisionObject * m_colObj
int m_numContactManifolds
double m_remainingLeastSquaresResidual
The btSolverBody is an internal datastructure for the constraint solver. Only necessary data is packe...
btVector3 m_angularVelocity
btVector3 m_deltaLinearVelocity
btVector3 m_deltaAngularVelocity
btVector3 m_linearVelocity
1D constraint along a normal axis between bodyA and bodyB. It can be combined to solve contact and fr...