116 if (
anchor.m_node->m_im == 0)
174 x[i] -= x[i].dot(dir0) * dir0;
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)
409 for (
int l = 0; l < 3; ++l)
412 for (
int k = 0;
k < 3; ++
k)
417 rv.m_vecs.push_back(v);
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;
448 for (
int j = 0;
j <
lm.m_num_constraints; ++
j)
450 for (
int k = 0;
k <
lm.m_num_nodes; ++
k)
452 d[
j] +=
lm.m_weights[
k] * x[
lm.m_indices[
k]].dot(
lm.m_dirs[
j]);
475 lm.m_indices[0] = index;
476 lm.m_weights[0] = 1.0;
477 lm.m_num_constraints = 3;
489 lm.m_indices[0] = index;
490 lm.m_weights[0] = 1.0;
491 lm.m_num_constraints = 3;
508 lm.m_indices[0] = index;
509 lm.m_weights[0] = 1.0;
512 lm.m_num_constraints = 3;
519 lm.m_num_constraints = 1;
537 for (
int k = 0;
k < 3; ++
k)
546 lm.m_num_constraints = 3;
554 lm.m_num_constraints = 1;
573 int index = node->
index;
581 for (
int k = 0;
k < 3; ++
k)
586 int index = node->
index;
598 int index = node->
index;
601 for (
int k = 0;
k < 3; ++
k)
606 int index = node->
index;
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.
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< 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.
btVector3 & normalize()
Normalize this vector x^2 + y^2 + z^2 = 1.