21 : m_softBodies(softBodies), m_projection(softBodies), m_backupVelocity(backup_v), m_implicit(
false)
45 for (
int i = 0; i <
m_lf.
size(); ++i)
47 m_lf[i]->reinitialize(nodeUpdated);
80 b[counter] = (node.m_im == 0) ?
btVector3(0, 0, 0) : x[counter] / node.m_im;
85 for (
int i = 0; i <
m_lf.
size(); ++i)
88 m_lf[i]->addScaledDampingForceDifferential(-
m_dt, x,
b);
92 m_lf[i]->addScaledElasticForceDifferential(-
m_dt *
m_dt, x,
b);
96 for (
int i = offset; i <
b.size(); ++i)
143 if (!psb->isActive())
154 psb->
m_nodes[j].m_v += psb->
m_nodes[j].m_effectiveMass_inv * force[counter++];
163 psb->
m_nodes[j].m_v += one_over_mass * force[counter++];
169 for (
int i = 0; i < force.
size(); ++i)
178 for (
int i = 0; i <
m_lf.
size(); ++i)
183 m_lf[i]->addScaledForces(dt, residual);
187 m_lf[i]->addScaledDampingForce(dt, residual);
196 for (
int i = 0; i < residual.
size(); ++i)
198 mag += residual[i].length2();
200 return std::sqrt(mag);
206 for (
int i = 0; i <
m_lf.
size(); ++i)
208 e +=
m_lf[i]->totalEnergy(dt);
223 for (
int i = 0; i <
m_lf.
size(); ++i)
231 m_lf[i]->addScaledForces(
m_dt, force);
234 for (
int i = 0; i <
m_lf.
size(); ++i)
253 for (
int i = 0; i <
m_lf.
size(); ++i)
255 m_lf[i]->addScaledExplicitForce(
m_dt, force);
266 psb->
m_nodes[j].m_effectiveMass_inv = psb->
m_nodes[j].m_effectiveMass.inverse();
281 dv[counter] = psb->
m_nodes[j].m_im * residual[counter];
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
void setZero()
Set the matrix to the identity.
btMatrix3x3
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with...
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btSequentialImpulseConstraintSolverMt int btPersistentManifold int btTypedConstraint int const btContactSolverInfo & infoGlobal
btVector3
btVector3 can be used to represent 3D points and vectors. It has an un-used w component to suit 16-by...
SIMD_FORCE_INLINE int size() const
return the number of elements in the array
local_group_size(16, 16) .push_constant(Type b