Bullet Collision Detection & Physics Library
|
Go to the documentation of this file.
51 for (
int i = 0; i <
m_dv.
size(); ++i)
101 f2 = f0 - alpha * scale * inner_product;
158 for (
int i = 0; i <
m_dv.
size(); ++i)
171 if (inner_product < -tol)
175 std::cout <<
"Looking backwards!" << std::endl;
181 inner_product = -inner_product;
183 else if (std::abs(inner_product) < tol)
187 std::cout <<
"Gradient Descent!" << std::endl;
192 m_ddv[i] = scale * residual[i];
194 inner_product = scale * res_norm * res_norm;
196 return inner_product;
260 return maxSquaredResidual;
280 m_dv[counter].setZero();
346 m_dv[counter].setZero();
419 BT_PROFILE(
"btDeformableBodySolver::predictDeformableMotion");
btCollisionObject can be used to manage collision detection objects.
void updateFaceTree(bool use_velocity, bool margin)
void setupDeformableSolve(bool implicit)
virtual void reinitialize(bool nodeUpdated)=0
virtual void updateSoftBodies()
Perform necessary per-step updates of soft bodies such as recomputing normals and bounding boxes.
btScalar computeDescentStep(TVStack &ddv, const TVStack &residual, bool verbose=false)
btAlignedObjectArray< DeformableFaceNodeContact > m_faceNodeContacts
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
void copyFromArray(const btAlignedObjectArray &otherArray)
int solve(MatrixX &A, TVStack &x, const TVStack &b, bool verbose=false)
@ SDF_RD
Cluster vs convex rigid vs soft.
virtual btScalar dot(const TVStack &a, const TVStack &b)
void updateEnergy(btScalar scale)
void reinitialize(const btAlignedObjectArray< btSoftBody * > &softBodies, btScalar dt)
void updateDv(btScalar scale=1)
void setLineSearch(bool lineSearch)
const T & btMax(const T &a, const T &b)
btConjugateResidual< btDeformableBackwardEulerObjective > m_cr
void updateNodeTree(bool use_velocity, bool margin)
btAlignedObjectArray< DeformableFaceRigidContact > m_faceRigidContacts
virtual btScalar getMargin() const =0
void resize(int newsize, const T &fillData=T())
void setConstraints(const btContactSolverInfo &infoGlobal)
btScalar m_newtonTolerance
btScalar m_maxSpeedSquared
void computeStep(TVStack &ddv, const TVStack &residual)
btConjugateGradient< btDeformableBackwardEulerObjective > m_cg
int m_maxNewtonIterations
int solve(MatrixX &A, TVStack &x, const TVStack &b, bool verbose=false)
void initializeFaceTree()
virtual btScalar solveContactConstraints(btCollisionObject **deformableBodies, int numDeformableBodies, const btContactSolverInfo &infoGlobal)
btVector3 can be used to represent 3D points and vectors.
void updateTempPosition()
The btSoftBody is an class to simulate cloth and volumetric soft bodies.
virtual void predictMotion(btScalar solverdt)
Predict motion of soft bodies into next timestep.
btAlignedObjectArray< DeformableNodeRigidContact > m_nodeRigidContacts
static const int kMaxConjugateGradientIterations
btScalar norm() const
Return the norm (length) of the vector.
btAlignedObjectArray< btSoftBody * > m_softBodies
void predictDeformableMotion(btSoftBody *psb, btScalar dt)
btDeformableBackwardEulerObjective * m_objective
virtual void solveDeformableConstraints(btScalar solverdt)
void setImplicit(bool implicit)
virtual ~btDeformableBodySolver()
btVector3 & safeNormalize()
int size() const
return the number of elements in the array
const btCollisionShape * getCollisionShape() const