45 for (
int i = 0; i <
m_lf.
size(); ++i)
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);
106 for (
int i = 0; i <
lm.m_num_nodes; ++i)
108 for (
int j = 0;
j <
lm.m_num_constraints; ++
j)
110 b[
lm.m_indices[i]] += x[
offset + c][
j] *
lm.m_weights[i] *
lm.m_dirs[
j];
114 for (
int d = 0; d <
lm.m_num_constraints; ++d)
116 for (
int i = 0; i <
lm.m_num_nodes; ++i)
118 b[
offset + c][d] +=
lm.m_weights[i] * x[
lm.m_indices[i]].dot(
lm.m_dirs[d]);
169 for (
int i = 0; i <
force.size(); ++i)
178 for (
int i = 0; i <
m_lf.
size(); ++i)
196 for (
int i = 0; i <
residual.size(); ++i)
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)
234 for (
int i = 0; i <
m_lf.
size(); ++i)
253 for (
int i = 0; i <
m_lf.
size(); ++i)
268 psb->
m_nodes[
j].m_effectiveMass_inv = psb->
m_nodes[
j].m_effectiveMass.inverse();
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...
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
int size() const
return the number of elements in the array
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with...
void setIdentity()
Set the matrix to the identity.
The btSoftBody is an class to simulate cloth and volumetric soft bodies.
btVector3 can be used to represent 3D points and vectors.