23 for (
int i = 0; i < numDeformableBodies; ++i)
28 if (psb != deformableBodies[i])
36 residualSquare =
btMax(residualSquare, localResidualSquare);
42 residualSquare =
btMax(residualSquare, localResidualSquare);
48 residualSquare =
btMax(residualSquare, localResidualSquare);
54 residualSquare =
btMax(residualSquare, localResidualSquare);
58 return residualSquare;
64 for (
int i = 0; i < numDeformableBodies; ++i)
69 if (psb != deformableBodies[i])
77 residualSquare =
btMax(residualSquare, localResidualSquare);
83 residualSquare =
btMax(residualSquare, localResidualSquare);
87 return residualSquare;
143 if (contact.
m_c2 == 0)
161 if (projectionDirs.
size() >= dim)
167 else if (projectionDirs.
size() == 2)
174 x[i] -= x[i].dot(dir0) * dir0;
179 x[i] = x[i].dot(free_dir) * free_dir;
186 x[i] -= x[i].dot(dir0) * dir0;
191 for (
int i = 0; i < m_projections.size(); ++i)
193 p += (m_projections[i].dot(x) * m_projections[i]);
205 BT_PROFILE(
"btDeformableContactProjection::setProjection");
228 for (
int k = 0; k < 3; ++k)
245 for (
int k = 0; k < 3; ++k)
266 for (
int k = 0; k < 3; ++k)
293 for (
int k = 0; k < 3; ++k)
298 for (
int k = 0; k < 3; ++k)
301 int index = node->
index;
311 for (
int l = 0; l < 3; ++l)
403 for (
int k = 0; k < 3; ++k)
405 face->
m_n[k]->m_penetration =
btMax(face->
m_n[k]->m_penetration, penetration);
409 for (
int l = 0; l < 3; ++l)
412 for (
int k = 0; k < 3; ++k)
420 m_projections.push_back(rv);
426 for (
int k = 0; k < 3; ++k)
432 m_projections.push_back(rv);
438 m_projections = mgs.
m_out;
537 for (
int k = 0; k < 3; ++k)
573 int index = node->
index;
574 f[index] += constraint.
getDv(node) * (1. / node->
m_im);
581 for (
int k = 0; k < 3; ++k)
586 int index = node->
index;
587 f[index] += constraint.
getDv(node) * (1. / node->
m_im);
598 int index = node->
index;
599 f[index] += constraint.
getDv(node) * (1. / node->
m_im);
601 for (
int k = 0; k < 3; ++k)
606 int index = node->
index;
607 f[index] += constraint.
getDv(node) * (1. / node->
m_im);
625 for (
int i = 0; i < N; ++i)
636 m_projections.clear();
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...
btVector3 btCross(const btVector3 &v1, const btVector3 &v2)
Return the cross product of two vectors.
int size() const
return the number of elements in the array
void resize(int newsize, const T &fillData=T())
void clear()
clear the array, deallocated memory. Generally it is better to use array.resize(0),...
void push_back(const T &_Val)
btCollisionObject can be used to manage collision detection objects.
btTransform & getWorldTransform()
void insert(const Key &key, const Value &value)
Key getKeyAtIndex(int index)
const Value * getAtIndex(int index) const
const Value * find(const Key &key) const
btAlignedObjectArray< TV > m_out
btAlignedObjectArray< int > m_indices
btAlignedObjectArray< btVector3 > m_vecs
The btSoftBody is an class to simulate cloth and volumetric soft bodies.
btAlignedObjectArray< DeformableFaceRigidContact > m_faceRigidContacts
btAlignedObjectArray< DeformableNodeRigidAnchor > m_deformableAnchors
btAlignedObjectArray< DeformableNodeRigidContact > m_nodeRigidContacts
btVector3 can be used to represent 3D points and vectors.
btScalar safeNorm() const
Return the norm (length) of the vector.
btVector3 & normalize()
Normalize this vector x^2 + y^2 + z^2 = 1.
const btCollisionObject * m_colObj