Bullet Collision Detection & Physics Library: btPersistentManifold.h Source File

Bullet Collision Detection & Physics Library

btPersistentManifold.h
Go to the documentation of this file.
1 /*
2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
4
5 This software is provided 'as-is', without any express or implied warranty.
6 In no event will the authors be held liable for any damages arising from the use of this software.
7 Permission is granted to anyone to use this software for any purpose,
8 including commercial applications, and to alter it and redistribute it freely,
9 subject to the following restrictions:
10
11 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13 3. This notice may not be removed or altered from any source distribution.
14 */
15
16 #ifndef BT_PERSISTENT_MANIFOLD_H
17 #define BT_PERSISTENT_MANIFOLD_H
18
19 #include "LinearMath/btVector3.h"
20 #include "LinearMath/btTransform.h"
21 #include "btManifoldPoint.h"
22 class btCollisionObject;
23 #include "LinearMath/btAlignedAllocator.h"
24
25 struct btCollisionResult;
26 struct btCollisionObjectDoubleData;
27 struct btCollisionObjectFloatData;
28
30 extern btScalar gContactBreakingThreshold;
31
32 #ifndef SWIG
33 class btPersistentManifold;
34
35 typedef bool (*ContactDestroyedCallback)(void* userPersistentData);
36 typedef bool (*ContactProcessedCallback)(btManifoldPoint& cp, void* body0, void* body1);
37 typedef void (*ContactStartedCallback)(btPersistentManifold* const& manifold);
38 typedef void (*ContactEndedCallback)(btPersistentManifold* const& manifold);
39 extern ContactDestroyedCallback gContactDestroyedCallback;
40 extern ContactProcessedCallback gContactProcessedCallback;
41 extern ContactStartedCallback gContactStartedCallback;
42 extern ContactEndedCallback gContactEndedCallback;
43 #endif //SWIG
44
45 //the enum starts at 1024 to avoid type conflicts with btTypedConstraint
46 enum btContactManifoldTypes
47 {
48 MIN_CONTACT_MANIFOLD_TYPE = 1024,
49 BT_PERSISTENT_MANIFOLD_TYPE
50 };
51
52 #define MANIFOLD_CACHE_SIZE 4
53
61
62 //ATTRIBUTE_ALIGNED128( class) btPersistentManifold : public btTypedObject
63 ATTRIBUTE_ALIGNED16(class)
64 btPersistentManifold : public btTypedObject
65 {
66 btManifoldPoint m_pointCache[MANIFOLD_CACHE_SIZE];
67
69 const btCollisionObject* m_body0;
70 const btCollisionObject* m_body1;
71
72 int m_cachedPoints;
73
74 btScalar m_contactBreakingThreshold;
75 btScalar m_contactProcessingThreshold;
76
78 int sortCachedPoints(const btManifoldPoint& pt);
79
80 int findContactPoint(const btManifoldPoint* unUsed, int numUnused, const btManifoldPoint& pt);
81
82 public:
83 BT_DECLARE_ALIGNED_ALLOCATOR();
84
85 int m_companionIdA;
86 int m_companionIdB;
87
88 int m_index1a;
89
90 btPersistentManifold();
91
92 btPersistentManifold(const btCollisionObject* body0, const btCollisionObject* body1, int, btScalar contactBreakingThreshold, btScalar contactProcessingThreshold)
93 : btTypedObject(BT_PERSISTENT_MANIFOLD_TYPE),
94 m_body0(body0),
95 m_body1(body1),
96 m_cachedPoints(0),
97 m_contactBreakingThreshold(contactBreakingThreshold),
98 m_contactProcessingThreshold(contactProcessingThreshold),
99 m_companionIdA(0),
100 m_companionIdB(0),
101 m_index1a(0)
102 {
103 }
104
105 SIMD_FORCE_INLINE const btCollisionObject* getBody0() const { return m_body0; }
106 SIMD_FORCE_INLINE const btCollisionObject* getBody1() const { return m_body1; }
107
108 void setBodies(const btCollisionObject* body0, const btCollisionObject* body1)
109 {
110 m_body0 = body0;
111 m_body1 = body1;
112 }
113
114 void clearUserCache(btManifoldPoint & pt);
115
116 #ifdef DEBUG_PERSISTENCY
117 void DebugPersistency();
118 #endif //
119
120 SIMD_FORCE_INLINE int getNumContacts() const
121 {
122 return m_cachedPoints;
123 }
125 void setNumContacts(int cachedPoints)
126 {
127 m_cachedPoints = cachedPoints;
128 }
129
130 SIMD_FORCE_INLINE const btManifoldPoint& getContactPoint(int index) const
131 {
132 btAssert(index < m_cachedPoints);
133 return m_pointCache[index];
134 }
135
136 SIMD_FORCE_INLINE btManifoldPoint& getContactPoint(int index)
137 {
138 btAssert(index < m_cachedPoints);
139 return m_pointCache[index];
140 }
141
143 btScalar getContactBreakingThreshold() const;
144
145 btScalar getContactProcessingThreshold() const
146 {
147 return m_contactProcessingThreshold;
148 }
149
150 void setContactBreakingThreshold(btScalar contactBreakingThreshold)
151 {
152 m_contactBreakingThreshold = contactBreakingThreshold;
153 }
154
155 void setContactProcessingThreshold(btScalar contactProcessingThreshold)
156 {
157 m_contactProcessingThreshold = contactProcessingThreshold;
158 }
159
160 int getCacheEntry(const btManifoldPoint& newPoint) const;
161
162 int addManifoldPoint(const btManifoldPoint& newPoint, bool isPredictive = false);
163
164 void removeContactPoint(int index)
165 {
166 clearUserCache(m_pointCache[index]);
167
168 int lastUsedIndex = getNumContacts() - 1;
169 // m_pointCache[index] = m_pointCache[lastUsedIndex];
170 if (index != lastUsedIndex)
171 {
172 m_pointCache[index] = m_pointCache[lastUsedIndex];
173 //get rid of duplicated userPersistentData pointer
174 m_pointCache[lastUsedIndex].m_userPersistentData = 0;
175 m_pointCache[lastUsedIndex].m_appliedImpulse = 0.f;
176 m_pointCache[lastUsedIndex].m_contactPointFlags = 0;
177 m_pointCache[lastUsedIndex].m_appliedImpulseLateral1 = 0.f;
178 m_pointCache[lastUsedIndex].m_appliedImpulseLateral2 = 0.f;
179 m_pointCache[lastUsedIndex].m_lifeTime = 0;
180 }
181
182 btAssert(m_pointCache[lastUsedIndex].m_userPersistentData == 0);
183 m_cachedPoints--;
184
185 if (gContactEndedCallback && m_cachedPoints == 0)
186 {
187 gContactEndedCallback(this);
188 }
189 }
190 void replaceContactPoint(const btManifoldPoint& newPoint, int insertIndex)
191 {
192 btAssert(validContactDistance(newPoint));
193
194 #define MAINTAIN_PERSISTENCY 1
195 #ifdef MAINTAIN_PERSISTENCY
196 int lifeTime = m_pointCache[insertIndex].getLifeTime();
197 btScalar appliedImpulse = m_pointCache[insertIndex].m_appliedImpulse;
198 btScalar appliedLateralImpulse1 = m_pointCache[insertIndex].m_appliedImpulseLateral1;
199 btScalar appliedLateralImpulse2 = m_pointCache[insertIndex].m_appliedImpulseLateral2;
200
201 bool replacePoint = true;
204 if (newPoint.m_contactPointFlags & BT_CONTACT_FLAG_FRICTION_ANCHOR)
205 {
206 // printf("appliedImpulse=%f\n", appliedImpulse);
207 // printf("appliedLateralImpulse1=%f\n", appliedLateralImpulse1);
208 // printf("appliedLateralImpulse2=%f\n", appliedLateralImpulse2);
209 // printf("mu = %f\n", m_pointCache[insertIndex].m_combinedFriction);
210 btScalar mu = m_pointCache[insertIndex].m_combinedFriction;
211 btScalar eps = 0; //we could allow to enlarge or shrink the tolerance to check against the friction cone a bit, say 1e-7
212 btScalar a = appliedLateralImpulse1 * appliedLateralImpulse1 + appliedLateralImpulse2 * appliedLateralImpulse2;
213 btScalar b = eps + mu * appliedImpulse;
214 b = b * b;
215 replacePoint = (a) > (b);
216 }
217
218 if (replacePoint)
219 {
220 btAssert(lifeTime >= 0);
221 void* cache = m_pointCache[insertIndex].m_userPersistentData;
222
223 m_pointCache[insertIndex] = newPoint;
224 m_pointCache[insertIndex].m_userPersistentData = cache;
225 m_pointCache[insertIndex].m_appliedImpulse = appliedImpulse;
226 m_pointCache[insertIndex].m_appliedImpulseLateral1 = appliedLateralImpulse1;
227 m_pointCache[insertIndex].m_appliedImpulseLateral2 = appliedLateralImpulse2;
228 }
229
230 m_pointCache[insertIndex].m_lifeTime = lifeTime;
231 #else
232 clearUserCache(m_pointCache[insertIndex]);
233 m_pointCache[insertIndex] = newPoint;
234
235 #endif
236 }
237
238 bool validContactDistance(const btManifoldPoint& pt) const
239 {
240 return pt.m_distance1 <= getContactBreakingThreshold();
241 }
243 void refreshContactPoints(const btTransform& trA, const btTransform& trB);
244
245 SIMD_FORCE_INLINE void clearManifold()
246 {
247 int i;
248 for (i = 0; i < m_cachedPoints; i++)
249 {
250 clearUserCache(m_pointCache[i]);
251 }
252
253 if (gContactEndedCallback && m_cachedPoints)
254 {
255 gContactEndedCallback(this);
256 }
257 m_cachedPoints = 0;
258 }
259
260 int calculateSerializeBufferSize() const;
261 const char* serialize(const class btPersistentManifold* manifold, void* dataBuffer, class btSerializer* serializer) const;
262 void deSerialize(const struct btPersistentManifoldDoubleData* manifoldDataPtr);
263 void deSerialize(const struct btPersistentManifoldFloatData* manifoldDataPtr);
264 };
265
266 // clang-format off
267
268 struct btPersistentManifoldDoubleData
269 {
270 btVector3DoubleData m_pointCacheLocalPointA[4];
271 btVector3DoubleData m_pointCacheLocalPointB[4];
272 btVector3DoubleData m_pointCachePositionWorldOnA[4];
273 btVector3DoubleData m_pointCachePositionWorldOnB[4];
274 btVector3DoubleData m_pointCacheNormalWorldOnB[4];
275 btVector3DoubleData m_pointCacheLateralFrictionDir1[4];
276 btVector3DoubleData m_pointCacheLateralFrictionDir2[4];
277 double m_pointCacheDistance[4];
278 double m_pointCacheAppliedImpulse[4];
279 double m_pointCacheCombinedFriction[4];
280 double m_pointCacheCombinedRollingFriction[4];
281 double m_pointCacheCombinedSpinningFriction[4];
282 double m_pointCacheCombinedRestitution[4];
283 int m_pointCachePartId0[4];
284 int m_pointCachePartId1[4];
285 int m_pointCacheIndex0[4];
286 int m_pointCacheIndex1[4];
287 int m_pointCacheContactPointFlags[4];
288 double m_pointCacheAppliedImpulseLateral1[4];
289 double m_pointCacheAppliedImpulseLateral2[4];
290 double m_pointCacheContactMotion1[4];
291 double m_pointCacheContactMotion2[4];
292 double m_pointCacheContactCFM[4];
293 double m_pointCacheCombinedContactStiffness1[4];
294 double m_pointCacheContactERP[4];
295 double m_pointCacheCombinedContactDamping1[4];
296 double m_pointCacheFrictionCFM[4];
297 int m_pointCacheLifeTime[4];
298
299 int m_numCachedPoints;
300 int m_companionIdA;
301 int m_companionIdB;
302 int m_index1a;
303
304 int m_objectType;
305 double m_contactBreakingThreshold;
306 double m_contactProcessingThreshold;
307 int m_padding;
308
309 btCollisionObjectDoubleData *m_body0;
310 btCollisionObjectDoubleData *m_body1;
311 };
312
313
314 struct btPersistentManifoldFloatData
315 {
316 btVector3FloatData m_pointCacheLocalPointA[4];
317 btVector3FloatData m_pointCacheLocalPointB[4];
318 btVector3FloatData m_pointCachePositionWorldOnA[4];
319 btVector3FloatData m_pointCachePositionWorldOnB[4];
320 btVector3FloatData m_pointCacheNormalWorldOnB[4];
321 btVector3FloatData m_pointCacheLateralFrictionDir1[4];
322 btVector3FloatData m_pointCacheLateralFrictionDir2[4];
323 float m_pointCacheDistance[4];
324 float m_pointCacheAppliedImpulse[4];
325 float m_pointCacheCombinedFriction[4];
326 float m_pointCacheCombinedRollingFriction[4];
327 float m_pointCacheCombinedSpinningFriction[4];
328 float m_pointCacheCombinedRestitution[4];
329 int m_pointCachePartId0[4];
330 int m_pointCachePartId1[4];
331 int m_pointCacheIndex0[4];
332 int m_pointCacheIndex1[4];
333 int m_pointCacheContactPointFlags[4];
334 float m_pointCacheAppliedImpulseLateral1[4];
335 float m_pointCacheAppliedImpulseLateral2[4];
336 float m_pointCacheContactMotion1[4];
337 float m_pointCacheContactMotion2[4];
338 float m_pointCacheContactCFM[4];
339 float m_pointCacheCombinedContactStiffness1[4];
340 float m_pointCacheContactERP[4];
341 float m_pointCacheCombinedContactDamping1[4];
342 float m_pointCacheFrictionCFM[4];
343 int m_pointCacheLifeTime[4];
344
345 int m_numCachedPoints;
346 int m_companionIdA;
347 int m_companionIdB;
348 int m_index1a;
349
350 int m_objectType;
351 float m_contactBreakingThreshold;
352 float m_contactProcessingThreshold;
353 int m_padding;
354
355 btCollisionObjectFloatData *m_body0;
356 btCollisionObjectFloatData *m_body1;
357 };
358
359 // clang-format on
360
361 #ifdef BT_USE_DOUBLE_PRECISION
362 #define btPersistentManifoldData btPersistentManifoldDoubleData
363 #define btPersistentManifoldDataName "btPersistentManifoldDoubleData"
364 #else
365 #define btPersistentManifoldData btPersistentManifoldFloatData
366 #define btPersistentManifoldDataName "btPersistentManifoldFloatData"
367 #endif //BT_USE_DOUBLE_PRECISION
368
369 #endif //BT_PERSISTENT_MANIFOLD_H
btManifoldPoint::m_contactPointFlags
int m_contactPointFlags
Definition: btManifoldPoint.h:114
btPersistentManifold::m_companionIdA
int m_companionIdA
Definition: btPersistentManifold.h:85
btPersistentManifoldFloatData::m_pointCacheDistance
float m_pointCacheDistance[4]
Definition: btPersistentManifold.h:323
btPersistentManifoldDoubleData::m_padding
int m_padding
Definition: btPersistentManifold.h:307
btPersistentManifold
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
Definition: btPersistentManifold.h:63
btCollisionObjectFloatData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btCollisionObject.h:626
btPersistentManifold::m_body1
const btCollisionObject * m_body1
Definition: btPersistentManifold.h:70
btPersistentManifold::getContactBreakingThreshold
btScalar getContactBreakingThreshold() const
Definition: btPersistentManifold.cpp:242
btPersistentManifoldDoubleData::m_pointCachePositionWorldOnB
btVector3DoubleData m_pointCachePositionWorldOnB[4]
Definition: btPersistentManifold.h:273
btPersistentManifoldDoubleData::m_pointCacheAppliedImpulseLateral2
double m_pointCacheAppliedImpulseLateral2[4]
Definition: btPersistentManifold.h:289
btPersistentManifoldDoubleData::m_pointCacheContactMotion1
double m_pointCacheContactMotion1[4]
Definition: btPersistentManifold.h:290
btPersistentManifold::refreshContactPoints
void refreshContactPoints(const btTransform &trA, const btTransform &trB)
calculated new worldspace coordinates and depth, and reject points that exceed the collision margin ...
Definition: btPersistentManifold.cpp:247
btPersistentManifoldFloatData::m_pointCacheIndex0
int m_pointCacheIndex0[4]
Definition: btPersistentManifold.h:331
btPersistentManifoldDoubleData::m_body1
btCollisionObjectDoubleData * m_body1
Definition: btPersistentManifold.h:310
BT_PERSISTENT_MANIFOLD_TYPE
Definition: btPersistentManifold.h:49
btPersistentManifoldFloatData::m_pointCachePartId0
int m_pointCachePartId0[4]
Definition: btPersistentManifold.h:329
btPersistentManifoldFloatData::m_pointCacheContactMotion1
float m_pointCacheContactMotion1[4]
Definition: btPersistentManifold.h:336
btVector3.h
btPersistentManifoldFloatData::m_padding
int m_padding
Definition: btPersistentManifold.h:353
btManifoldPoint::m_appliedImpulseLateral1
btScalar m_appliedImpulseLateral1
Definition: btManifoldPoint.h:117
MIN_CONTACT_MANIFOLD_TYPE
Definition: btPersistentManifold.h:48
btPersistentManifoldFloatData::m_pointCacheCombinedFriction
float m_pointCacheCombinedFriction[4]
Definition: btPersistentManifold.h:325
btPersistentManifoldDoubleData::m_companionIdA
int m_companionIdA
Definition: btPersistentManifold.h:300
btPersistentManifoldFloatData::m_body1
btCollisionObjectFloatData * m_body1
Definition: btPersistentManifold.h:356
ContactEndedCallback
void(* ContactEndedCallback)(btPersistentManifold *const &manifold)
Definition: btPersistentManifold.h:38
btPersistentManifoldFloatData::m_pointCacheAppliedImpulse
float m_pointCacheAppliedImpulse[4]
Definition: btPersistentManifold.h:324
btPersistentManifold::getNumContacts
int getNumContacts() const
Definition: btPersistentManifold.h:120
btPersistentManifoldFloatData::m_pointCacheAppliedImpulseLateral2
float m_pointCacheAppliedImpulseLateral2[4]
Definition: btPersistentManifold.h:335
btPersistentManifoldFloatData::m_contactBreakingThreshold
float m_contactBreakingThreshold
Definition: btPersistentManifold.h:351
btPersistentManifoldDoubleData::m_objectType
int m_objectType
Definition: btPersistentManifold.h:304
btManifoldPoint::m_appliedImpulse
btScalar m_appliedImpulse
Definition: btManifoldPoint.h:116
btPersistentManifoldFloatData::m_pointCacheLifeTime
int m_pointCacheLifeTime[4]
Definition: btPersistentManifold.h:343
btAssert
#define btAssert(x)
Definition: btScalar.h:133
btPersistentManifoldDoubleData::m_pointCacheCombinedFriction
double m_pointCacheCombinedFriction[4]
Definition: btPersistentManifold.h:279
btPersistentManifoldDoubleData::m_pointCacheLocalPointB
btVector3DoubleData m_pointCacheLocalPointB[4]
Definition: btPersistentManifold.h:271
btPersistentManifoldDoubleData::m_pointCacheCombinedRollingFriction
double m_pointCacheCombinedRollingFriction[4]
Definition: btPersistentManifold.h:280
btPersistentManifold::validContactDistance
bool validContactDistance(const btManifoldPoint &pt) const
Definition: btPersistentManifold.h:238
SIMD_FORCE_INLINE
#define SIMD_FORCE_INLINE
Definition: btScalar.h:83
gContactDestroyedCallback
ContactDestroyedCallback gContactDestroyedCallback
Definition: btPersistentManifold.cpp:27
btTransform.h
btManifoldPoint
ManifoldContactPoint collects and maintains persistent contactpoints.
Definition: btManifoldPoint.h:51
MANIFOLD_CACHE_SIZE
#define MANIFOLD_CACHE_SIZE
Definition: btPersistentManifold.h:52
btAlignedAllocator.h
btPersistentManifold::m_cachedPoints
int m_cachedPoints
Definition: btPersistentManifold.h:72
btPersistentManifoldFloatData::m_pointCacheCombinedContactStiffness1
float m_pointCacheCombinedContactStiffness1[4]
Definition: btPersistentManifold.h:339
btPersistentManifold::sortCachedPoints
int sortCachedPoints(const btManifoldPoint &pt)
sort cached points so most isolated points come first
Definition: btPersistentManifold.cpp:111
btPersistentManifoldDoubleData::m_companionIdB
int m_companionIdB
Definition: btPersistentManifold.h:301
btPersistentManifoldDoubleData::m_pointCacheCombinedSpinningFriction
double m_pointCacheCombinedSpinningFriction[4]
Definition: btPersistentManifold.h:281
btSerializer
Definition: btSerializer.h:65
btPersistentManifoldFloatData::m_pointCacheAppliedImpulseLateral1
float m_pointCacheAppliedImpulseLateral1[4]
Definition: btPersistentManifold.h:334
btPersistentManifold::getContactPoint
const btManifoldPoint & getContactPoint(int index) const
Definition: btPersistentManifold.h:130
btPersistentManifoldDoubleData::m_pointCacheLifeTime
int m_pointCacheLifeTime[4]
Definition: btPersistentManifold.h:297
btPersistentManifoldDoubleData::m_pointCacheCombinedContactStiffness1
double m_pointCacheCombinedContactStiffness1[4]
Definition: btPersistentManifold.h:293
btPersistentManifoldDoubleData::m_pointCacheNormalWorldOnB
btVector3DoubleData m_pointCacheNormalWorldOnB[4]
Definition: btPersistentManifold.h:274
btPersistentManifoldFloatData::m_pointCacheContactERP
float m_pointCacheContactERP[4]
Definition: btPersistentManifold.h:340
btPersistentManifoldDoubleData::m_pointCacheCombinedContactDamping1
double m_pointCacheCombinedContactDamping1[4]
Definition: btPersistentManifold.h:295
btPersistentManifold::setNumContacts
void setNumContacts(int cachedPoints)
the setNumContacts API is usually not used, except when you gather/fill all contacts manually ...
Definition: btPersistentManifold.h:125
btCollisionObjectDoubleData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btCollisionObject.h:591
btPersistentManifoldDoubleData::m_pointCachePositionWorldOnA
btVector3DoubleData m_pointCachePositionWorldOnA[4]
Definition: btPersistentManifold.h:272
btPersistentManifoldDoubleData::m_pointCacheAppliedImpulse
double m_pointCacheAppliedImpulse[4]
Definition: btPersistentManifold.h:278
btPersistentManifoldFloatData::m_pointCacheContactCFM
float m_pointCacheContactCFM[4]
Definition: btPersistentManifold.h:338
btManifoldPoint::m_userPersistentData
void * m_userPersistentData
Definition: btManifoldPoint.h:112
btPersistentManifold::m_companionIdB
int m_companionIdB
Definition: btPersistentManifold.h:86
btPersistentManifold::getContactPoint
btManifoldPoint & getContactPoint(int index)
Definition: btPersistentManifold.h:136
btPersistentManifoldFloatData::m_pointCacheLocalPointB
btVector3FloatData m_pointCacheLocalPointB[4]
Definition: btPersistentManifold.h:317
btPersistentManifold::getBody0
const btCollisionObject * getBody0() const
Definition: btPersistentManifold.h:105
btManifoldPoint::m_appliedImpulseLateral2
btScalar m_appliedImpulseLateral2
Definition: btManifoldPoint.h:118
ContactStartedCallback
void(* ContactStartedCallback)(btPersistentManifold *const &manifold)
Definition: btPersistentManifold.h:37
btPersistentManifoldDoubleData::m_pointCacheContactMotion2
double m_pointCacheContactMotion2[4]
Definition: btPersistentManifold.h:291
btPersistentManifoldDoubleData::m_pointCacheDistance
double m_pointCacheDistance[4]
Definition: btPersistentManifold.h:277
gContactBreakingThreshold
btScalar gContactBreakingThreshold
maximum contact breaking and merging threshold
Definition: btPersistentManifold.cpp:26
btPersistentManifold::btPersistentManifold
btPersistentManifold()
Definition: btPersistentManifold.cpp:35
btContactManifoldTypes
btContactManifoldTypes
Definition: btPersistentManifold.h:46
btManifoldPoint::m_lifeTime
int m_lifeTime
Definition: btManifoldPoint.h:134
btPersistentManifoldFloatData::m_companionIdB
int m_companionIdB
Definition: btPersistentManifold.h:347
btPersistentManifoldFloatData
Definition: btPersistentManifold.h:314
btCollisionObject
btCollisionObject can be used to manage collision detection objects.
Definition: btCollisionObject.h:48
btPersistentManifoldFloatData::m_pointCachePositionWorldOnB
btVector3FloatData m_pointCachePositionWorldOnB[4]
Definition: btPersistentManifold.h:319
btPersistentManifoldFloatData::m_contactProcessingThreshold
float m_contactProcessingThreshold
Definition: btPersistentManifold.h:352
btPersistentManifoldDoubleData::m_pointCacheLateralFrictionDir1
btVector3DoubleData m_pointCacheLateralFrictionDir1[4]
Definition: btPersistentManifold.h:275
btPersistentManifoldFloatData::m_pointCacheNormalWorldOnB
btVector3FloatData m_pointCacheNormalWorldOnB[4]
Definition: btPersistentManifold.h:320
btPersistentManifold::getContactProcessingThreshold
btScalar getContactProcessingThreshold() const
Definition: btPersistentManifold.h:145
gContactStartedCallback
ContactStartedCallback gContactStartedCallback
Definition: btPersistentManifold.cpp:29
btPersistentManifold::m_index1a
int m_index1a
Definition: btPersistentManifold.h:88
btPersistentManifoldFloatData::m_pointCacheContactMotion2
float m_pointCacheContactMotion2[4]
Definition: btPersistentManifold.h:337
btPersistentManifold::calculateSerializeBufferSize
int calculateSerializeBufferSize() const
Definition: btPersistentManifold.cpp:304
btPersistentManifoldDoubleData::m_body0
btCollisionObjectDoubleData * m_body0
Definition: btPersistentManifold.h:309
ContactDestroyedCallback
bool(* ContactDestroyedCallback)(void *userPersistentData)
Definition: btPersistentManifold.h:35
btPersistentManifoldDoubleData::m_pointCacheIndex0
int m_pointCacheIndex0[4]
Definition: btPersistentManifold.h:285
btPersistentManifoldFloatData::m_objectType
int m_objectType
Definition: btPersistentManifold.h:350
btPersistentManifoldDoubleData::m_pointCachePartId1
int m_pointCachePartId1[4]
Definition: btPersistentManifold.h:284
ATTRIBUTE_ALIGNED16
#define ATTRIBUTE_ALIGNED16(a)
Definition: btScalar.h:84
btPersistentManifoldDoubleData::m_pointCacheContactPointFlags
int m_pointCacheContactPointFlags[4]
Definition: btPersistentManifold.h:287
btPersistentManifoldDoubleData::m_pointCacheIndex1
int m_pointCacheIndex1[4]
Definition: btPersistentManifold.h:286
btPersistentManifold::removeContactPoint
void removeContactPoint(int index)
Definition: btPersistentManifold.h:164
btTransform
The btTransform class supports rigid transforms with only translation and rotation and no scaling/she...
Definition: btTransform.h:28
btPersistentManifoldFloatData::m_pointCacheIndex1
int m_pointCacheIndex1[4]
Definition: btPersistentManifold.h:332
gContactProcessedCallback
ContactProcessedCallback gContactProcessedCallback
Definition: btPersistentManifold.cpp:28
btPersistentManifoldFloatData::m_pointCacheLocalPointA
btVector3FloatData m_pointCacheLocalPointA[4]
Definition: btPersistentManifold.h:316
btPersistentManifoldFloatData::m_pointCacheCombinedContactDamping1
float m_pointCacheCombinedContactDamping1[4]
Definition: btPersistentManifold.h:341
btManifoldPoint::m_distance1
btScalar m_distance1
Definition: btManifoldPoint.h:100
btPersistentManifoldDoubleData::m_contactProcessingThreshold
double m_contactProcessingThreshold
Definition: btPersistentManifold.h:306
btPersistentManifold::clearManifold
void clearManifold()
Definition: btPersistentManifold.h:245
ContactProcessedCallback
bool(* ContactProcessedCallback)(btManifoldPoint &cp, void *body0, void *body1)
Definition: btPersistentManifold.h:36
btPersistentManifoldFloatData::m_pointCacheContactPointFlags
int m_pointCacheContactPointFlags[4]
Definition: btPersistentManifold.h:333
btTypedObject
rudimentary class to provide type info
Definition: btScalar.h:779
btPersistentManifoldDoubleData::m_pointCacheCombinedRestitution
double m_pointCacheCombinedRestitution[4]
Definition: btPersistentManifold.h:282
btPersistentManifoldDoubleData::m_pointCacheContactCFM
double m_pointCacheContactCFM[4]
Definition: btPersistentManifold.h:292
btPersistentManifoldFloatData::m_pointCacheLateralFrictionDir2
btVector3FloatData m_pointCacheLateralFrictionDir2[4]
Definition: btPersistentManifold.h:322
btPersistentManifoldDoubleData::m_contactBreakingThreshold
double m_contactBreakingThreshold
Definition: btPersistentManifold.h:305
BT_CONTACT_FLAG_FRICTION_ANCHOR
Definition: btManifoldPoint.h:46
btPersistentManifoldFloatData::m_index1a
int m_index1a
Definition: btPersistentManifold.h:348
btPersistentManifold::getBody1
const btCollisionObject * getBody1() const
Definition: btPersistentManifold.h:106
btPersistentManifoldFloatData::m_companionIdA
int m_companionIdA
Definition: btPersistentManifold.h:346
btPersistentManifoldFloatData::m_pointCacheFrictionCFM
float m_pointCacheFrictionCFM[4]
Definition: btPersistentManifold.h:342
btPersistentManifold::clearUserCache
void clearUserCache(btManifoldPoint &pt)
Definition: btPersistentManifold.cpp:59
btPersistentManifoldDoubleData::m_pointCacheFrictionCFM
double m_pointCacheFrictionCFM[4]
Definition: btPersistentManifold.h:296
BT_DECLARE_ALIGNED_ALLOCATOR
#define BT_DECLARE_ALIGNED_ALLOCATOR()
Definition: btScalar.h:405
btManifoldPoint::m_combinedFriction
btScalar m_combinedFriction
Definition: btManifoldPoint.h:101
btPersistentManifoldDoubleData::m_pointCacheLateralFrictionDir2
btVector3DoubleData m_pointCacheLateralFrictionDir2[4]
Definition: btPersistentManifold.h:276
btPersistentManifold::serialize
const char * serialize(const class btPersistentManifold *manifold, void *dataBuffer, class btSerializer *serializer) const
Definition: btPersistentManifold.cpp:309
btPersistentManifoldDoubleData::m_pointCacheAppliedImpulseLateral1
double m_pointCacheAppliedImpulseLateral1[4]
Definition: btPersistentManifold.h:288
btPersistentManifold::m_contactProcessingThreshold
btScalar m_contactProcessingThreshold
Definition: btPersistentManifold.h:75
btPersistentManifold::setContactProcessingThreshold
void setContactProcessingThreshold(btScalar contactProcessingThreshold)
Definition: btPersistentManifold.h:155
btPersistentManifold::m_contactBreakingThreshold
btScalar m_contactBreakingThreshold
Definition: btPersistentManifold.h:74
btVector3FloatData
Definition: btVector3.h:1281
btPersistentManifold::deSerialize
void deSerialize(const struct btPersistentManifoldDoubleData *manifoldDataPtr)
Definition: btPersistentManifold.cpp:359
btPersistentManifold::btPersistentManifold
btPersistentManifold(const btCollisionObject *body0, const btCollisionObject *body1, int, btScalar contactBreakingThreshold, btScalar contactProcessingThreshold)
Definition: btPersistentManifold.h:92
btPersistentManifoldDoubleData::m_pointCachePartId0
int m_pointCachePartId0[4]
Definition: btPersistentManifold.h:283
btPersistentManifoldFloatData::m_body0
btCollisionObjectFloatData * m_body0
Definition: btPersistentManifold.h:355
btPersistentManifoldDoubleData::m_pointCacheLocalPointA
btVector3DoubleData m_pointCacheLocalPointA[4]
Definition: btPersistentManifold.h:270
btPersistentManifoldFloatData::m_numCachedPoints
int m_numCachedPoints
Definition: btPersistentManifold.h:345
btPersistentManifold::replaceContactPoint
void replaceContactPoint(const btManifoldPoint &newPoint, int insertIndex)
Definition: btPersistentManifold.h:190
btPersistentManifold::findContactPoint
int findContactPoint(const btManifoldPoint *unUsed, int numUnused, const btManifoldPoint &pt)
btPersistentManifoldFloatData::m_pointCacheCombinedSpinningFriction
float m_pointCacheCombinedSpinningFriction[4]
Definition: btPersistentManifold.h:327
btPersistentManifold::setContactBreakingThreshold
void setContactBreakingThreshold(btScalar contactBreakingThreshold)
Definition: btPersistentManifold.h:150
btManifoldPoint.h
btPersistentManifoldDoubleData
Definition: btPersistentManifold.h:268
btPersistentManifold::m_body0
const btCollisionObject * m_body0
this two body pointers can point to the physics rigidbody class.
Definition: btPersistentManifold.h:69
gContactEndedCallback
ContactEndedCallback gContactEndedCallback
Definition: btPersistentManifold.cpp:30
btPersistentManifoldDoubleData::m_index1a
int m_index1a
Definition: btPersistentManifold.h:302
btPersistentManifoldDoubleData::m_pointCacheContactERP
double m_pointCacheContactERP[4]
Definition: btPersistentManifold.h:294
btPersistentManifold::addManifoldPoint
int addManifoldPoint(const btManifoldPoint &newPoint, bool isPredictive=false)
Definition: btPersistentManifold.cpp:212
btManifoldPoint::getLifeTime
int getLifeTime() const
Definition: btManifoldPoint.h:143
btPersistentManifold::setBodies
void setBodies(const btCollisionObject *body0, const btCollisionObject *body1)
Definition: btPersistentManifold.h:108
btPersistentManifoldFloatData::m_pointCacheLateralFrictionDir1
btVector3FloatData m_pointCacheLateralFrictionDir1[4]
Definition: btPersistentManifold.h:321
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:294
btVector3DoubleData
Definition: btVector3.h:1286
btPersistentManifoldFloatData::m_pointCachePositionWorldOnA
btVector3FloatData m_pointCachePositionWorldOnA[4]
Definition: btPersistentManifold.h:318
btPersistentManifold::m_pointCache
btManifoldPoint m_pointCache[MANIFOLD_CACHE_SIZE]
Definition: btPersistentManifold.h:66
btPersistentManifoldFloatData::m_pointCacheCombinedRollingFriction
float m_pointCacheCombinedRollingFriction[4]
Definition: btPersistentManifold.h:326
btPersistentManifoldFloatData::m_pointCachePartId1
int m_pointCachePartId1[4]
Definition: btPersistentManifold.h:330
btPersistentManifold::getCacheEntry
int getCacheEntry(const btManifoldPoint &newPoint) const
Definition: btPersistentManifold.cpp:192
btPersistentManifoldDoubleData::m_numCachedPoints
int m_numCachedPoints
Definition: btPersistentManifold.h:299
btPersistentManifoldFloatData::m_pointCacheCombinedRestitution
float m_pointCacheCombinedRestitution[4]
Definition: btPersistentManifold.h:328