|
Bullet Collision Detection & Physics Library
|
Go to the documentation of this file.
23 #define MAX_COINCIDENT 8
74 if(contacts.
size()==0)
return;
77 if(contacts.
size()==1)
89 for ( i = 0;i<contacts.
size() ;i++ )
98 int coincident_count=0;
101 unsigned int last_key = keycontacts[0].m_key;
102 unsigned int key = 0;
104 push_back(contacts[keycontacts[0].m_value]);
108 for( i=1;i<keycontacts.
size();i++)
110 key = keycontacts[i].m_key;
111 const GIM_CONTACT * scontact = &contacts[keycontacts[i].m_value];
118 *pcontact = *scontact;
119 coincident_count = 0;
121 else if(normal_contact_average)
127 coincident_normals[coincident_count] = scontact->
m_normal;
136 if(normal_contact_average && coincident_count>0)
139 coincident_count = 0;
143 pcontact = &(*this)[this->
size()-1];
153 if(contacts.
size()==0)
return;
155 if(contacts.
size()==1)
163 for (
int i=1;i<contacts.
size() ;i++ )
165 average_contact.
m_point += contacts[i].m_point;
166 average_contact.
m_normal += contacts[i].m_normal * contacts[i].m_depth;
172 average_contact.
m_point *= divide_average;
174 average_contact.
m_normal *= divide_average;
btScalar length() const
Return the length of the vector.
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
void quickSort(const L &CompareFunc)
void clear()
clear the array, deallocated memory. Generally it is better to use array.resize(0),...
btScalar btFabs(btScalar x)
btVector3 can be used to represent 3D points and vectors.
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
void push_back(const GIM_CONTACT &_Val)
int size() const
return the number of elements in the array