23#define MAX_COINCIDENT 8
71 if (contacts.
size() == 0)
return;
73 if (contacts.
size() == 1)
85 for (i = 0; i < contacts.
size(); i++)
94 int coincident_count = 0;
97 unsigned int last_key = keycontacts[0].m_key;
100 push_back(contacts[keycontacts[0].m_value]);
104 for (i = 1; i < keycontacts.
size(); i++)
106 key = keycontacts[i].m_key;
107 const GIM_CONTACT* scontact = &contacts[keycontacts[i].m_value];
114 *pcontact = *scontact;
115 coincident_count = 0;
117 else if (normal_contact_average)
123 coincident_normals[coincident_count] = scontact->
m_normal;
132 if (normal_contact_average && coincident_count > 0)
135 coincident_count = 0;
139 pcontact = &(*this)[this->
size() - 1];
149 if (contacts.
size() == 0)
return;
151 if (contacts.
size() == 1)
159 for (
int i = 1; i < contacts.
size(); i++)
161 average_contact.
m_point += contacts[i].m_point;
162 average_contact.
m_normal += contacts[i].m_normal * contacts[i].m_depth;
168 average_contact.
m_point *= divide_average;
170 average_contact.
m_normal *= divide_average;
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btScalar btFabs(btScalar x)
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
void clear()
clear the array, deallocated memory. Generally it is better to use array.resize(0),...
void quickSort(const L &CompareFunc)
void push_back(const GIM_CONTACT &_Val)
btVector3 can be used to represent 3D points and vectors.
btScalar length() const
Return the length of the vector.