22 #if !defined(AFX_DGCONTACT_H__BDE5B2AC_5834_46FD_A994_65D855788F69__INCLUDED_) 23 #define AFX_DGCONTACT_H__BDE5B2AC_5834_46FD_A994_65D855788F69__INCLUDED_ 26 #include "dgConstraint.h" 38 #define DG_MAX_CONTATCS 128 39 #define DG_CACHE_PAIR_BUFFER 256 41 typedef int(dgApi *OnAABBOverlap)(
const NewtonMaterial *
const material,
const NewtonBody *
const body0,
const NewtonBody *
const body1, int32 threadIndex);
42 typedef void(dgApi *OnContactCallback)(
const NewtonJoint *
const contact, dFloat timestep, int32 threadIndex);
59 dgInt16 m_contactCount;
65 dgPair m_chacheBuffer[DG_CACHE_PAIR_BUFFER];
76 void AddPair(
dgBody *
const body0,
dgBody *
const body1, dgInt32 threadIndex);
87 DG_MSC_VECTOR_ALIGMENT
97 dgFloat32 m_penetration;
98 dgInt32 m_isEdgeContact;
99 } DG_GCC_VECTOR_ALIGMENT;
101 DG_MSC_VECTOR_ALIGMENT
110 dgFloat32 m_timestep;
111 dgFloat32 m_penetrationPadding;
112 dgInt32 m_continueCollision;
113 dgInt32 m_unconditionalCast;
114 dgInt32 m_threadIndex;
115 dgInt32 m_maxContacts;
122 dgUnsigned32 m_isTriggerVolume : 1;
123 dgUnsigned32 m_inTriggerVolume : 1;
127 m_threadIndex = threadIndex;
128 m_polyMeshData = NULL;
129 m_localMatrixInv = NULL;
133 } DG_GCC_VECTOR_ALIGMENT;
137 DG_MSC_VECTOR_ALIGMENT
142 m_collisionEnable__ = 1 << 0,
143 m_friction0Enable__ = 1 << 1,
144 m_friction1Enable__ = 1 << 2,
145 m_override0Accel__ = 1 << 3,
146 m_override1Accel__ = 1 << 4,
147 m_overrideNormalAccel__ = 1 << 5,
148 m_collisionContinueCollisionEnable__ = 1 << 6,
152 void *GetUserData()
const;
153 void SetUserData(
void *
const userData);
154 void SetCollisionCallback(OnAABBOverlap abbOvelap, OnContactCallback callback);
155 void SetCompoundCollisionCallback(OnAABBOverlap abbOvelap);
159 dgFloat32 m_normal_Force;
160 dgFloat32 m_dir0_Force;
161 dgFloat32 m_dir1_Force;
162 dgFloat32 m_softness;
163 dgFloat32 m_restitution;
164 dgFloat32 m_staticFriction0;
165 dgFloat32 m_staticFriction1;
166 dgFloat32 m_dynamicFriction0;
167 dgFloat32 m_dynamicFriction1;
168 dgFloat32 m_penetrationPadding;
185 OnAABBOverlap m_aabbOverlap;
186 OnContactCallback m_contactPoint;
187 OnAABBOverlap m_compoundAABBOverlap;
196 } DG_GCC_VECTOR_ALIGMENT;
200 DG_MSC_VECTOR_ALIGMENT
203 public dgList<dgContactMaterial> {
208 DG_CLASS_ALLOCATOR(allocator)
216 virtual void SetDestructorCallback(OnConstraintDestroy destructor);
228 dgActiveContacts::dgListNode *m_contactNode;
230 dgInt32 m_broadphaseLru;
234 friend class dgTireCollision;
238 } DG_GCC_VECTOR_ALIGMENT;
240 inline void dgContactMaterial::SetCollisionCallback(OnAABBOverlap aabbOverlap, OnContactCallback contact) {
241 m_aabbOverlap = aabbOverlap;
242 m_contactPoint = contact;
245 inline void dgContactMaterial::SetCompoundCollisionCallback(OnAABBOverlap aabbOverlap) {
246 m_compoundAABBOverlap = aabbOverlap;
249 inline void *dgContactMaterial::GetUserData()
const {
253 inline void dgContactMaterial::SetUserData(
void *
const userData) {
254 m_userData = userData;
259 inline void dgContact::SetDestructorCallback(OnConstraintDestroy destructor) {
Definition: dgWorldDynamicUpdate.h:101
Definition: dgContact.h:51
Definition: dgBroadPhaseCollision.h:170
Definition: dgCollisionMesh.h:39
Definition: dgVector.h:86
Definition: dgContact.h:63
Definition: dgQuaternion.h:31
Definition: dgConstraint.h:137
Definition: dgConstraint.h:48
Definition: dgBroadPhaseCollision.h:158
Definition: dgConstraint.h:191
Definition: dgCollision.h:178
Definition: dgMatrix.h:41
Definition: dgMemory.h:80
Definition: dgConstraint.h:169
Definition: dgWorld.h:118
Definition: dgConstraint.h:116
Definition: dgContact.h:53
Definition: dgCollisionCompound.h:31
Definition: dgContact.h:102