Bullet Collision Detection & Physics Library
|
Go to the documentation of this file.
16 #ifndef BT_NEOHOOKEAN_H
17 #define BT_NEOHOOKEAN_H
75 size_t id0 = node0->
index;
76 size_t id1 = node1->
index;
77 size_t id2 = node2->
index;
78 size_t id3 = node3->
index;
89 force[id0] -= scale1 * df_on_node0;
90 force[id1] -= scale1 * df_on_node123.getColumn(0);
91 force[id2] -= scale1 * df_on_node123.getColumn(1);
92 force[id3] -= scale1 * df_on_node123.getColumn(2);
135 dampingForce.
resize(sz+1);
136 for (
int i = 0; i < dampingForce.
size(); ++i)
137 dampingForce[i].setZero();
145 energy -= dampingForce[node.
index].dot(node.
m_v) / dt;
183 btScalar trPTP = (P[0].length2() + P[1].length2() + P[2].length2());
184 if (trPTP > max_p * max_p)
189 sigma[0] =
btMin(sigma[0], max_p);
190 sigma[1] =
btMin(sigma[1], max_p);
191 sigma[2] =
btMin(sigma[2], max_p);
192 sigma[0] =
btMax(sigma[0], -max_p);
193 sigma[1] =
btMax(sigma[1], -max_p);
194 sigma[2] =
btMax(sigma[2], -max_p);
197 Sigma[0][0] = sigma[0];
198 Sigma[1][1] = sigma[1];
199 Sigma[2][2] = sigma[2];
206 btVector3 force_on_node0 = force_on_node123 * grad_N_hat_1st_col;
212 size_t id0 = node0->
index;
213 size_t id1 = node1->
index;
214 size_t id2 = node2->
index;
215 size_t id3 = node3->
index;
219 force[id0] -= scale1 * force_on_node0;
220 force[id1] -= scale1 * force_on_node123.
getColumn(0);
221 force[id2] -= scale1 * force_on_node123.
getColumn(1);
222 force[id3] -= scale1 * force_on_node123.
getColumn(2);
249 size_t id0 = node0->
index;
250 size_t id1 = node1->
index;
251 size_t id2 = node2->
index;
252 size_t id3 = node3->
index;
260 btVector3 df_on_node0 = df_on_node123 * grad_N_hat_1st_col;
264 df[id0] -= scale1 * df_on_node0;
265 df[id1] -= scale1 * df_on_node123.
getColumn(0);
266 df[id2] -= scale1 * df_on_node123.
getColumn(1);
267 df[id3] -= scale1 * df_on_node123.
getColumn(2);
291 size_t id0 = node0->
index;
292 size_t id1 = node1->
index;
293 size_t id2 = node2->
index;
294 size_t id3 = node3->
index;
300 btVector3 df_on_node0 = df_on_node123 * grad_N_hat_1st_col;
304 df[id0] -= scale1 * df_on_node0;
305 df[id1] -= scale1 * df_on_node123.
getColumn(0);
306 df[id2] -= scale1 * df_on_node123.
getColumn(1);
307 df[id3] -= scale1 * df_on_node123.
getColumn(2);
326 dP = dF * c1 + s.
m_F * c2;
338 dP = dF * c1 + s.
m_F * c2;
346 for (
int i = 0; i < 3; ++i)
348 ans += A[i].dot(B[i]);
358 M[0][0] += scale * (dF[1][1] * F[2][2] + F[1][1] * dF[2][2] - dF[2][1] * F[1][2] - F[2][1] * dF[1][2]);
359 M[1][0] += scale * (dF[2][1] * F[0][2] + F[2][1] * dF[0][2] - dF[0][1] * F[2][2] - F[0][1] * dF[2][2]);
360 M[2][0] += scale * (dF[0][1] * F[1][2] + F[0][1] * dF[1][2] - dF[1][1] * F[0][2] - F[1][1] * dF[0][2]);
361 M[0][1] += scale * (dF[2][0] * F[1][2] + F[2][0] * dF[1][2] - dF[1][0] * F[2][2] - F[1][0] * dF[2][2]);
362 M[1][1] += scale * (dF[0][0] * F[2][2] + F[0][0] * dF[2][2] - dF[2][0] * F[0][2] - F[2][0] * dF[0][2]);
363 M[2][1] += scale * (dF[1][0] * F[0][2] + F[1][0] * dF[0][2] - dF[0][0] * F[1][2] - F[0][0] * dF[1][2]);
364 M[0][2] += scale * (dF[1][0] * F[2][1] + F[1][0] * dF[2][1] - dF[2][0] * F[1][1] - F[2][0] * dF[1][1]);
365 M[1][2] += scale * (dF[2][0] * F[0][1] + F[2][0] * dF[0][1] - dF[0][0] * F[2][1] - F[0][0] * dF[2][1]);
366 M[2][2] += scale * (dF[0][0] * F[1][1] + F[0][0] * dF[1][1] - dF[1][0] * F[0][1] - F[1][0] * dF[0][1]);
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
const T & btMin(const T &a, const T &b)
const T & btMax(const T &a, const T &b)
btAlignedObjectArray< TetraScratch > m_tetraScratches
btScalar m_element_measure
void resize(int newsize, const T &fillData=T())
void singularValueDecomposition(const btMatrix2x2 &A, GivensRotation &U, const btMatrix2x2 &Sigma, GivensRotation &V, const btScalar tol=64 *std::numeric_limits< btScalar >::epsilon())
2x2 SVD (singular value decomposition) A=USV'
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with...
btMatrix3x3 transpose() const
Return the transpose of the matrix.
btVector3 getColumn(int i) const
Get a column of the matrix as a vector.
btVector3 can be used to represent 3D points and vectors.
The btSoftBody is an class to simulate cloth and volumetric soft bodies.
void setIdentity()
Set the matrix to the identity.
int size() const
return the number of elements in the array