Bullet Collision Detection & Physics Library
|
Go to the documentation of this file.
25 , m_maxNewtonIterations(5)
26 , m_newtonTolerance(1e-4)
88 f2 = f0 - alpha * scale * inner_product;
159 if (inner_product < -tol)
163 std::cout <<
"Looking backwards!" << std::endl;
169 inner_product = -inner_product;
171 else if (std::abs(inner_product) < tol)
175 std::cout <<
"Gradient Descent!" << std::endl;
180 m_ddv[i] = scale * residual[i];
182 inner_product = scale * res_norm * res_norm;
184 return inner_product;
241 return maxSquaredResidual;
272 m_dv[counter].setZero();
void optimizeIncremental(int passes)
btScalar solveContactConstraints(btCollisionObject **deformableBodies, int numDeformableBodies)
btCollisionObject can be used to manage collision detection objects.
void setupDeformableSolve(bool implicit)
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)
Cluster vs convex rigid vs soft.
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)
void update(btDbvtNode *leaf, int lookahead=-1)
btAlignedObjectArray< DeformableFaceRigidContact > m_faceRigidContacts
virtual btScalar getMargin() const =0
void resize(int newsize, const T &fillData=T())
btScalar m_newtonTolerance
btScalar m_maxSpeedSquared
void computeStep(TVStack &ddv, const TVStack &residual)
btConjugateGradient< btDeformableBackwardEulerObjective > m_cg
int m_maxNewtonIterations
void initializeFaceTree()
btVector3 can be used to represent 3D points and vectors.
#define ATTRIBUTE_ALIGNED16(a)
static btDbvtAabbMm FromPoints(const btVector3 *pts, int n)
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.
btScalar solveSplitImpulse(const btContactSolverInfo &infoGlobal)
btAlignedObjectArray< DeformableNodeRigidContact > m_nodeRigidContacts
static const int kMaxConjugateGradientIterations
btScalar dot(const TVStack &a, const TVStack &b)
btScalar norm() const
Return the norm (length) of the vector.
void predictDeformableMotion(btSoftBody *psb, btScalar dt)
btDeformableBackwardEulerObjective * m_objective
btAlignedObjectArray< btSoftBody * > m_softBodies
virtual void solveDeformableConstraints(btScalar solverdt)
void splitImpulseSetup(const btContactSolverInfo &infoGlobal)
void setImplicit(bool implicit)
virtual ~btDeformableBodySolver()
btVector3 & safeNormalize()
int size() const
return the number of elements in the array
const btCollisionShape * getCollisionShape() const