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

Bullet Collision Detection & Physics Library

btCollisionObject.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_COLLISION_OBJECT_H
17 #define BT_COLLISION_OBJECT_H
18
19 #include "LinearMath/btTransform.h"
20
21 //island management, m_activationState1
22 #define ACTIVE_TAG 1
23 #define ISLAND_SLEEPING 2
24 #define WANTS_DEACTIVATION 3
25 #define DISABLE_DEACTIVATION 4
26 #define DISABLE_SIMULATION 5
27
28 struct btBroadphaseProxy;
29 class btCollisionShape;
30 struct btCollisionShapeData;
31 #include "LinearMath/btMotionState.h"
32 #include "LinearMath/btAlignedAllocator.h"
33 #include "LinearMath/btAlignedObjectArray.h"
34
35 typedef btAlignedObjectArray<class btCollisionObject*> btCollisionObjectArray;
36
37 #ifdef BT_USE_DOUBLE_PRECISION
38 #define btCollisionObjectData btCollisionObjectDoubleData
39 #define btCollisionObjectDataName "btCollisionObjectDoubleData"
40 #else
41 #define btCollisionObjectData btCollisionObjectFloatData
42 #define btCollisionObjectDataName "btCollisionObjectFloatData"
43 #endif
44
48 ATTRIBUTE_ALIGNED16(class)
49 btCollisionObject
50 {
51 protected:
52 btTransform m_worldTransform;
53
56 btTransform m_interpolationWorldTransform;
57 //those two are experimental: just added for bullet time effect, so you can still apply impulses (directly modifying velocities)
58 //without destroying the continuous interpolated motion (which uses this interpolation velocities)
59 btVector3 m_interpolationLinearVelocity;
60 btVector3 m_interpolationAngularVelocity;
61
62 btVector3 m_anisotropicFriction;
63 int m_hasAnisotropicFriction;
64 btScalar m_contactProcessingThreshold;
65
66 btBroadphaseProxy* m_broadphaseHandle;
67 btCollisionShape* m_collisionShape;
69 void* m_extensionPointer;
70
74 btCollisionShape* m_rootCollisionShape;
75
76 int m_collisionFlags;
77
78 int m_islandTag1;
79 int m_companionId;
80 int m_worldArrayIndex; // index of object in world's collisionObjects array
81
82 mutable int m_activationState1;
83 mutable btScalar m_deactivationTime;
84
85 btScalar m_friction;
86 btScalar m_restitution;
87 btScalar m_rollingFriction; //torsional friction orthogonal to contact normal (useful to stop spheres rolling forever)
88 btScalar m_spinningFriction; // torsional friction around the contact normal (useful for grasping)
89 btScalar m_contactDamping;
90 btScalar m_contactStiffness;
91
94 int m_internalType;
95
97
98 void* m_userObjectPointer;
99
100 int m_userIndex2;
101
102 int m_userIndex;
103
105 btScalar m_hitFraction;
106
108 btScalar m_ccdSweptSphereRadius;
109
111 btScalar m_ccdMotionThreshold;
112
114 int m_checkCollideWith;
115
116 btAlignedObjectArray<const btCollisionObject*> m_objectsWithoutCollisionCheck;
117
119 int m_updateRevision;
120
121 btVector3 m_customDebugColorRGB;
122
123 public:
124 BT_DECLARE_ALIGNED_ALLOCATOR();
125
126 enum CollisionFlags
127 {
128 CF_STATIC_OBJECT = 1,
129 CF_KINEMATIC_OBJECT = 2,
130 CF_NO_CONTACT_RESPONSE = 4,
131 CF_CUSTOM_MATERIAL_CALLBACK = 8, //this allows per-triangle material (friction/restitution)
132 CF_CHARACTER_OBJECT = 16,
133 CF_DISABLE_VISUALIZE_OBJECT = 32, //disable debug drawing
134 CF_DISABLE_SPU_COLLISION_PROCESSING = 64, //disable parallel/SPU processing
135 CF_HAS_CONTACT_STIFFNESS_DAMPING = 128,
136 CF_HAS_CUSTOM_DEBUG_RENDERING_COLOR = 256,
137 CF_HAS_FRICTION_ANCHOR = 512,
138 CF_HAS_COLLISION_SOUND_TRIGGER = 1024
139 };
140
141 enum CollisionObjectTypes
142 {
143 CO_COLLISION_OBJECT = 1,
144 CO_RIGID_BODY = 2,
147 CO_GHOST_OBJECT = 4,
148 CO_SOFT_BODY = 8,
149 CO_HF_FLUID = 16,
150 CO_USER_TYPE = 32,
151 CO_FEATHERSTONE_LINK = 64
152 };
153
154 enum AnisotropicFrictionFlags
155 {
156 CF_ANISOTROPIC_FRICTION_DISABLED = 0,
157 CF_ANISOTROPIC_FRICTION = 1,
158 CF_ANISOTROPIC_ROLLING_FRICTION = 2
159 };
160
161 SIMD_FORCE_INLINE bool mergesSimulationIslands() const
162 {
164 return ((m_collisionFlags & (CF_STATIC_OBJECT | CF_KINEMATIC_OBJECT | CF_NO_CONTACT_RESPONSE)) == 0);
165 }
166
167 const btVector3& getAnisotropicFriction() const
168 {
169 return m_anisotropicFriction;
170 }
171 void setAnisotropicFriction(const btVector3& anisotropicFriction, int frictionMode = CF_ANISOTROPIC_FRICTION)
172 {
173 m_anisotropicFriction = anisotropicFriction;
174 bool isUnity = (anisotropicFriction[0] != 1.f) || (anisotropicFriction[1] != 1.f) || (anisotropicFriction[2] != 1.f);
175 m_hasAnisotropicFriction = isUnity ? frictionMode : 0;
176 }
177 bool hasAnisotropicFriction(int frictionMode = CF_ANISOTROPIC_FRICTION) const
178 {
179 return (m_hasAnisotropicFriction & frictionMode) != 0;
180 }
181
184 void setContactProcessingThreshold(btScalar contactProcessingThreshold)
185 {
186 m_contactProcessingThreshold = contactProcessingThreshold;
187 }
188 btScalar getContactProcessingThreshold() const
189 {
190 return m_contactProcessingThreshold;
191 }
192
193 SIMD_FORCE_INLINE bool isStaticObject() const
194 {
195 return (m_collisionFlags & CF_STATIC_OBJECT) != 0;
196 }
197
198 SIMD_FORCE_INLINE bool isKinematicObject() const
199 {
200 return (m_collisionFlags & CF_KINEMATIC_OBJECT) != 0;
201 }
202
203 SIMD_FORCE_INLINE bool isStaticOrKinematicObject() const
204 {
205 return (m_collisionFlags & (CF_KINEMATIC_OBJECT | CF_STATIC_OBJECT)) != 0;
206 }
207
208 SIMD_FORCE_INLINE bool hasContactResponse() const
209 {
210 return (m_collisionFlags & CF_NO_CONTACT_RESPONSE) == 0;
211 }
212
213 btCollisionObject();
214
215 virtual ~btCollisionObject();
216
217 virtual void setCollisionShape(btCollisionShape * collisionShape)
218 {
219 m_updateRevision++;
220 m_collisionShape = collisionShape;
221 m_rootCollisionShape = collisionShape;
222 }
223
224 SIMD_FORCE_INLINE const btCollisionShape* getCollisionShape() const
225 {
226 return m_collisionShape;
227 }
228
229 SIMD_FORCE_INLINE btCollisionShape* getCollisionShape()
230 {
231 return m_collisionShape;
232 }
233
234 void setIgnoreCollisionCheck(const btCollisionObject* co, bool ignoreCollisionCheck)
235 {
236 if (ignoreCollisionCheck)
237 {
238 //We don't check for duplicates. Is it ok to leave that up to the user of this API?
239 //int index = m_objectsWithoutCollisionCheck.findLinearSearch(co);
240 //if (index == m_objectsWithoutCollisionCheck.size())
241 //{
242 m_objectsWithoutCollisionCheck.push_back(co);
243 //}
244 }
245 else
246 {
247 m_objectsWithoutCollisionCheck.remove(co);
248 }
249 m_checkCollideWith = m_objectsWithoutCollisionCheck.size() > 0;
250 }
251
252 virtual bool checkCollideWithOverride(const btCollisionObject* co) const
253 {
254 int index = m_objectsWithoutCollisionCheck.findLinearSearch(co);
255 if (index < m_objectsWithoutCollisionCheck.size())
256 {
257 return false;
258 }
259 return true;
260 }
261
264 void* internalGetExtensionPointer() const
265 {
266 return m_extensionPointer;
267 }
270 void internalSetExtensionPointer(void* pointer)
271 {
272 m_extensionPointer = pointer;
273 }
274
275 SIMD_FORCE_INLINE int getActivationState() const { return m_activationState1; }
276
277 void setActivationState(int newState) const;
278
279 void setDeactivationTime(btScalar time)
280 {
281 m_deactivationTime = time;
282 }
283 btScalar getDeactivationTime() const
284 {
285 return m_deactivationTime;
286 }
287
288 void forceActivationState(int newState) const;
289
290 void activate(bool forceActivation = false) const;
291
292 SIMD_FORCE_INLINE bool isActive() const
293 {
294 return ((getActivationState() != ISLAND_SLEEPING) && (getActivationState() != DISABLE_SIMULATION));
295 }
296
297 void setRestitution(btScalar rest)
298 {
299 m_updateRevision++;
300 m_restitution = rest;
301 }
302 btScalar getRestitution() const
303 {
304 return m_restitution;
305 }
306 void setFriction(btScalar frict)
307 {
308 m_updateRevision++;
309 m_friction = frict;
310 }
311 btScalar getFriction() const
312 {
313 return m_friction;
314 }
315
316 void setRollingFriction(btScalar frict)
317 {
318 m_updateRevision++;
319 m_rollingFriction = frict;
320 }
321 btScalar getRollingFriction() const
322 {
323 return m_rollingFriction;
324 }
325 void setSpinningFriction(btScalar frict)
326 {
327 m_updateRevision++;
328 m_spinningFriction = frict;
329 }
330 btScalar getSpinningFriction() const
331 {
332 return m_spinningFriction;
333 }
334 void setContactStiffnessAndDamping(btScalar stiffness, btScalar damping)
335 {
336 m_updateRevision++;
337 m_contactStiffness = stiffness;
338 m_contactDamping = damping;
339
340 m_collisionFlags |= CF_HAS_CONTACT_STIFFNESS_DAMPING;
341
342 //avoid divisions by zero...
343 if (m_contactStiffness < SIMD_EPSILON)
344 {
345 m_contactStiffness = SIMD_EPSILON;
346 }
347 }
348
349 btScalar getContactStiffness() const
350 {
351 return m_contactStiffness;
352 }
353
354 btScalar getContactDamping() const
355 {
356 return m_contactDamping;
357 }
358
360 int getInternalType() const
361 {
362 return m_internalType;
363 }
364
365 btTransform& getWorldTransform()
366 {
367 return m_worldTransform;
368 }
369
370 const btTransform& getWorldTransform() const
371 {
372 return m_worldTransform;
373 }
374
375 void setWorldTransform(const btTransform& worldTrans)
376 {
377 m_updateRevision++;
378 m_worldTransform = worldTrans;
379 }
380
381 SIMD_FORCE_INLINE btBroadphaseProxy* getBroadphaseHandle()
382 {
383 return m_broadphaseHandle;
384 }
385
386 SIMD_FORCE_INLINE const btBroadphaseProxy* getBroadphaseHandle() const
387 {
388 return m_broadphaseHandle;
389 }
390
391 void setBroadphaseHandle(btBroadphaseProxy * handle)
392 {
393 m_broadphaseHandle = handle;
394 }
395
396 const btTransform& getInterpolationWorldTransform() const
397 {
398 return m_interpolationWorldTransform;
399 }
400
401 btTransform& getInterpolationWorldTransform()
402 {
403 return m_interpolationWorldTransform;
404 }
405
406 void setInterpolationWorldTransform(const btTransform& trans)
407 {
408 m_updateRevision++;
409 m_interpolationWorldTransform = trans;
410 }
411
412 void setInterpolationLinearVelocity(const btVector3& linvel)
413 {
414 m_updateRevision++;
415 m_interpolationLinearVelocity = linvel;
416 }
417
418 void setInterpolationAngularVelocity(const btVector3& angvel)
419 {
420 m_updateRevision++;
421 m_interpolationAngularVelocity = angvel;
422 }
423
424 const btVector3& getInterpolationLinearVelocity() const
425 {
426 return m_interpolationLinearVelocity;
427 }
428
429 const btVector3& getInterpolationAngularVelocity() const
430 {
431 return m_interpolationAngularVelocity;
432 }
433
434 SIMD_FORCE_INLINE int getIslandTag() const
435 {
436 return m_islandTag1;
437 }
438
439 void setIslandTag(int tag)
440 {
441 m_islandTag1 = tag;
442 }
443
444 SIMD_FORCE_INLINE int getCompanionId() const
445 {
446 return m_companionId;
447 }
448
449 void setCompanionId(int id)
450 {
451 m_companionId = id;
452 }
453
454 SIMD_FORCE_INLINE int getWorldArrayIndex() const
455 {
456 return m_worldArrayIndex;
457 }
458
459 // only should be called by CollisionWorld
460 void setWorldArrayIndex(int ix)
461 {
462 m_worldArrayIndex = ix;
463 }
464
465 SIMD_FORCE_INLINE btScalar getHitFraction() const
466 {
467 return m_hitFraction;
468 }
469
470 void setHitFraction(btScalar hitFraction)
471 {
472 m_hitFraction = hitFraction;
473 }
474
475 SIMD_FORCE_INLINE int getCollisionFlags() const
476 {
477 return m_collisionFlags;
478 }
479
480 void setCollisionFlags(int flags)
481 {
482 m_collisionFlags = flags;
483 }
484
486 btScalar getCcdSweptSphereRadius() const
487 {
488 return m_ccdSweptSphereRadius;
489 }
490
492 void setCcdSweptSphereRadius(btScalar radius)
493 {
494 m_ccdSweptSphereRadius = radius;
495 }
496
497 btScalar getCcdMotionThreshold() const
498 {
499 return m_ccdMotionThreshold;
500 }
501
502 btScalar getCcdSquareMotionThreshold() const
503 {
504 return m_ccdMotionThreshold * m_ccdMotionThreshold;
505 }
506
508 void setCcdMotionThreshold(btScalar ccdMotionThreshold)
509 {
510 m_ccdMotionThreshold = ccdMotionThreshold;
511 }
512
514 void* getUserPointer() const
515 {
516 return m_userObjectPointer;
517 }
518
519 int getUserIndex() const
520 {
521 return m_userIndex;
522 }
523
524 int getUserIndex2() const
525 {
526 return m_userIndex2;
527 }
528
530 void setUserPointer(void* userPointer)
531 {
532 m_userObjectPointer = userPointer;
533 }
534
536 void setUserIndex(int index)
537 {
538 m_userIndex = index;
539 }
540
541 void setUserIndex2(int index)
542 {
543 m_userIndex2 = index;
544 }
545
546 int getUpdateRevisionInternal() const
547 {
548 return m_updateRevision;
549 }
550
551 void setCustomDebugColor(const btVector3& colorRGB)
552 {
553 m_customDebugColorRGB = colorRGB;
554 m_collisionFlags |= CF_HAS_CUSTOM_DEBUG_RENDERING_COLOR;
555 }
556
557 void removeCustomDebugColor()
558 {
559 m_collisionFlags &= ~CF_HAS_CUSTOM_DEBUG_RENDERING_COLOR;
560 }
561
562 bool getCustomDebugColor(btVector3 & colorRGB) const
563 {
564 bool hasCustomColor = (0 != (m_collisionFlags & CF_HAS_CUSTOM_DEBUG_RENDERING_COLOR));
565 if (hasCustomColor)
566 {
567 colorRGB = m_customDebugColorRGB;
568 }
569 return hasCustomColor;
570 }
571
572 inline bool checkCollideWith(const btCollisionObject* co) const
573 {
574 if (m_checkCollideWith)
575 return checkCollideWithOverride(co);
576
577 return true;
578 }
579
580 virtual int calculateSerializeBufferSize() const;
581
583 virtual const char* serialize(void* dataBuffer, class btSerializer* serializer) const;
584
585 virtual void serializeSingleObject(class btSerializer * serializer) const;
586 };
587
588 // clang-format off
589
591 struct btCollisionObjectDoubleData
592 {
593 void *m_broadphaseHandle;
594 void *m_collisionShape;
595 btCollisionShapeData *m_rootCollisionShape;
596 char *m_name;
597
598 btTransformDoubleData m_worldTransform;
599 btTransformDoubleData m_interpolationWorldTransform;
600 btVector3DoubleData m_interpolationLinearVelocity;
601 btVector3DoubleData m_interpolationAngularVelocity;
602 btVector3DoubleData m_anisotropicFriction;
603 double m_contactProcessingThreshold;
604 double m_deactivationTime;
605 double m_friction;
606 double m_rollingFriction;
607 double m_contactDamping;
608 double m_contactStiffness;
609 double m_restitution;
610 double m_hitFraction;
611 double m_ccdSweptSphereRadius;
612 double m_ccdMotionThreshold;
613 int m_hasAnisotropicFriction;
614 int m_collisionFlags;
615 int m_islandTag1;
616 int m_companionId;
617 int m_activationState1;
618 int m_internalType;
619 int m_checkCollideWith;
620 int m_collisionFilterGroup;
621 int m_collisionFilterMask;
622 int m_uniqueId;//m_uniqueId is introduced for paircache. could get rid of this, by calculating the address offset etc.
623 };
624
626 struct btCollisionObjectFloatData
627 {
628 void *m_broadphaseHandle;
629 void *m_collisionShape;
630 btCollisionShapeData *m_rootCollisionShape;
631 char *m_name;
632
633 btTransformFloatData m_worldTransform;
634 btTransformFloatData m_interpolationWorldTransform;
635 btVector3FloatData m_interpolationLinearVelocity;
636 btVector3FloatData m_interpolationAngularVelocity;
637 btVector3FloatData m_anisotropicFriction;
638 float m_contactProcessingThreshold;
639 float m_deactivationTime;
640 float m_friction;
641 float m_rollingFriction;
642 float m_contactDamping;
643 float m_contactStiffness;
644 float m_restitution;
645 float m_hitFraction;
646 float m_ccdSweptSphereRadius;
647 float m_ccdMotionThreshold;
648 int m_hasAnisotropicFriction;
649 int m_collisionFlags;
650 int m_islandTag1;
651 int m_companionId;
652 int m_activationState1;
653 int m_internalType;
654 int m_checkCollideWith;
655 int m_collisionFilterGroup;
656 int m_collisionFilterMask;
657 int m_uniqueId;
658 };
659 // clang-format on
660
661 SIMD_FORCE_INLINE int btCollisionObject::calculateSerializeBufferSize() const
662 {
663 return sizeof(btCollisionObjectData);
664 }
665
666 #endif //BT_COLLISION_OBJECT_H
btCollisionObject::m_companionId
int m_companionId
Definition: btCollisionObject.h:79
btCollisionObjectFloatData::m_worldTransform
btTransformFloatData m_worldTransform
Definition: btCollisionObject.h:633
btCollisionObject::setUserIndex2
void setUserIndex2(int index)
Definition: btCollisionObject.h:541
btCollisionObject::m_userIndex2
int m_userIndex2
Definition: btCollisionObject.h:100
SIMD_EPSILON
#define SIMD_EPSILON
Definition: btScalar.h:523
btCollisionObjectFloatData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btCollisionObject.h:626
btCollisionObject::getInterpolationAngularVelocity
const btVector3 & getInterpolationAngularVelocity() const
Definition: btCollisionObject.h:429
btCollisionObject::setContactStiffnessAndDamping
void setContactStiffnessAndDamping(btScalar stiffness, btScalar damping)
Definition: btCollisionObject.h:334
btAlignedObjectArray::push_back
void push_back(const T &_Val)
Definition: btAlignedObjectArray.h:264
btCollisionObject::AnisotropicFrictionFlags
AnisotropicFrictionFlags
Definition: btCollisionObject.h:154
btCollisionObjectDoubleData::m_contactProcessingThreshold
double m_contactProcessingThreshold
Definition: btCollisionObject.h:603
btCollisionObject::getUserIndex2
int getUserIndex2() const
Definition: btCollisionObject.h:524
btCollisionObjectFloatData::m_anisotropicFriction
btVector3FloatData m_anisotropicFriction
Definition: btCollisionObject.h:637
btCollisionObject::getContactDamping
btScalar getContactDamping() const
Definition: btCollisionObject.h:354
btCollisionObject::mergesSimulationIslands
bool mergesSimulationIslands() const
Definition: btCollisionObject.h:161
btCollisionObject::m_ccdMotionThreshold
btScalar m_ccdMotionThreshold
Don&#39;t do continuous collision detection if the motion (in one step) is less then m_ccdMotionThreshold...
Definition: btCollisionObject.h:111
btAlignedObjectArray
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
Definition: btAlignedObjectArray.h:52
btAlignedObjectArray::findLinearSearch
int findLinearSearch(const T &key) const
Definition: btAlignedObjectArray.h:445
btCollisionObject::getBroadphaseHandle
const btBroadphaseProxy * getBroadphaseHandle() const
Definition: btCollisionObject.h:386
btCollisionObjectFloatData::m_islandTag1
int m_islandTag1
Definition: btCollisionObject.h:650
btCollisionObject::m_interpolationWorldTransform
btTransform m_interpolationWorldTransform
m_interpolationWorldTransform is used for CCD and interpolation it can be either previous or future (...
Definition: btCollisionObject.h:56
btCollisionObject::m_ccdSweptSphereRadius
btScalar m_ccdSweptSphereRadius
Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm::
Definition: btCollisionObject.h:108
btCollisionObject::removeCustomDebugColor
void removeCustomDebugColor()
Definition: btCollisionObject.h:557
btCollisionObjectFloatData::m_interpolationWorldTransform
btTransformFloatData m_interpolationWorldTransform
Definition: btCollisionObject.h:634
btCollisionObjectFloatData::m_ccdMotionThreshold
float m_ccdMotionThreshold
Definition: btCollisionObject.h:647
btCollisionObject::setCcdMotionThreshold
void setCcdMotionThreshold(btScalar ccdMotionThreshold)
Don&#39;t do continuous collision detection if the motion (in one step) is less then m_ccdMotionThreshold...
Definition: btCollisionObject.h:508
btCollisionObject::getContactStiffness
btScalar getContactStiffness() const
Definition: btCollisionObject.h:349
btCollisionObjectFloatData::m_deactivationTime
float m_deactivationTime
Definition: btCollisionObject.h:639
btCollisionObjectDoubleData::m_ccdSweptSphereRadius
double m_ccdSweptSphereRadius
Definition: btCollisionObject.h:611
btCollisionObject::m_objectsWithoutCollisionCheck
btAlignedObjectArray< const btCollisionObject * > m_objectsWithoutCollisionCheck
Definition: btCollisionObject.h:116
btCollisionObject::m_hitFraction
btScalar m_hitFraction
time of impact calculation
Definition: btCollisionObject.h:105
btCollisionShape
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
Definition: btCollisionShape.h:26
btCollisionObject::setHitFraction
void setHitFraction(btScalar hitFraction)
Definition: btCollisionObject.h:470
btCollisionObjectDoubleData::m_contactStiffness
double m_contactStiffness
Definition: btCollisionObject.h:608
btCollisionObject::m_contactDamping
btScalar m_contactDamping
Definition: btCollisionObject.h:89
btCollisionObject::isKinematicObject
bool isKinematicObject() const
Definition: btCollisionObject.h:198
btCollisionObject::getWorldTransform
const btTransform & getWorldTransform() const
Definition: btCollisionObject.h:370
btCollisionObject::setWorldArrayIndex
void setWorldArrayIndex(int ix)
Definition: btCollisionObject.h:460
SIMD_FORCE_INLINE
#define SIMD_FORCE_INLINE
Definition: btScalar.h:83
btCollisionObjectDoubleData::m_name
char * m_name
Definition: btCollisionObject.h:596
btCollisionObjectFloatData::m_hasAnisotropicFriction
int m_hasAnisotropicFriction
Definition: btCollisionObject.h:648
btTransform.h
btCollisionObject::getActivationState
int getActivationState() const
Definition: btCollisionObject.h:275
btCollisionObjectDoubleData::m_hasAnisotropicFriction
int m_hasAnisotropicFriction
Definition: btCollisionObject.h:613
btAlignedAllocator.h
btCollisionObjectFloatData::m_restitution
float m_restitution
Definition: btCollisionObject.h:644
btCollisionObjectData
#define btCollisionObjectData
Definition: btCollisionObject.h:41
btCollisionObject::m_spinningFriction
btScalar m_spinningFriction
Definition: btCollisionObject.h:88
btCollisionObject::m_worldTransform
btTransform m_worldTransform
Definition: btCollisionObject.h:52
btCollisionObjectDoubleData::m_collisionFlags
int m_collisionFlags
Definition: btCollisionObject.h:614
ISLAND_SLEEPING
#define ISLAND_SLEEPING
Definition: btCollisionObject.h:23
btCollisionObject::isStaticOrKinematicObject
bool isStaticOrKinematicObject() const
Definition: btCollisionObject.h:203
btCollisionObject::setCustomDebugColor
void setCustomDebugColor(const btVector3 &colorRGB)
Definition: btCollisionObject.h:551
btCollisionObjectDoubleData::m_anisotropicFriction
btVector3DoubleData m_anisotropicFriction
Definition: btCollisionObject.h:602
btCollisionObject::m_collisionShape
btCollisionShape * m_collisionShape
Definition: btCollisionObject.h:67
btCollisionObjectFloatData::m_rootCollisionShape
btCollisionShapeData * m_rootCollisionShape
Definition: btCollisionObject.h:630
btCollisionObject::setIgnoreCollisionCheck
void setIgnoreCollisionCheck(const btCollisionObject *co, bool ignoreCollisionCheck)
Definition: btCollisionObject.h:234
btCollisionObjectFloatData::m_hitFraction
float m_hitFraction
Definition: btCollisionObject.h:645
btCollisionObjectDoubleData::m_hitFraction
double m_hitFraction
Definition: btCollisionObject.h:610
btCollisionObject::setRestitution
void setRestitution(btScalar rest)
Definition: btCollisionObject.h:297
btCollisionObject::checkCollideWith
bool checkCollideWith(const btCollisionObject *co) const
Definition: btCollisionObject.h:572
btSerializer
Definition: btSerializer.h:65
btCollisionObject::m_worldArrayIndex
int m_worldArrayIndex
Definition: btCollisionObject.h:80
btCollisionObjectDoubleData::m_interpolationAngularVelocity
btVector3DoubleData m_interpolationAngularVelocity
Definition: btCollisionObject.h:601
btCollisionObjectDoubleData::m_rootCollisionShape
btCollisionShapeData * m_rootCollisionShape
Definition: btCollisionObject.h:595
btCollisionObject::getInterpolationLinearVelocity
const btVector3 & getInterpolationLinearVelocity() const
Definition: btCollisionObject.h:424
btCollisionObject::m_anisotropicFriction
btVector3 m_anisotropicFriction
Definition: btCollisionObject.h:62
btCollisionObject::m_deactivationTime
btScalar m_deactivationTime
Definition: btCollisionObject.h:83
btCollisionObject::setCollisionShape
virtual void setCollisionShape(btCollisionShape *collisionShape)
Definition: btCollisionObject.h:217
btCollisionObjectDoubleData::m_internalType
int m_internalType
Definition: btCollisionObject.h:618
btCollisionObject::m_hasAnisotropicFriction
int m_hasAnisotropicFriction
Definition: btCollisionObject.h:63
btCollisionObjectDoubleData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btCollisionObject.h:591
btCollisionObjectFloatData::m_collisionShape
void * m_collisionShape
Definition: btCollisionObject.h:629
btCollisionObject::getWorldTransform
btTransform & getWorldTransform()
Definition: btCollisionObject.h:365
btCollisionObject::m_internalType
int m_internalType
m_internalType is reserved to distinguish Bullet&#39;s btCollisionObject, btRigidBody, btSoftBody, btGhostObject etc.
Definition: btCollisionObject.h:94
btCollisionObject::getBroadphaseHandle
btBroadphaseProxy * getBroadphaseHandle()
Definition: btCollisionObject.h:381
btCollisionObjectDoubleData::m_checkCollideWith
int m_checkCollideWith
Definition: btCollisionObject.h:619
btCollisionObject::getAnisotropicFriction
const btVector3 & getAnisotropicFriction() const
Definition: btCollisionObject.h:167
btCollisionObject::setFriction
void setFriction(btScalar frict)
Definition: btCollisionObject.h:306
btCollisionObject::getCcdSquareMotionThreshold
btScalar getCcdSquareMotionThreshold() const
Definition: btCollisionObject.h:502
btCollisionObject::isStaticObject
bool isStaticObject() const
Definition: btCollisionObject.h:193
btCollisionObject::setCcdSweptSphereRadius
void setCcdSweptSphereRadius(btScalar radius)
Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm::
Definition: btCollisionObject.h:492
btCollisionObject::m_rootCollisionShape
btCollisionShape * m_rootCollisionShape
m_rootCollisionShape is temporarily used to store the original collision shape The m_collisionShape m...
Definition: btCollisionObject.h:74
btCollisionObject::setSpinningFriction
void setSpinningFriction(btScalar frict)
Definition: btCollisionObject.h:325
btCollisionObjectFloatData::m_interpolationLinearVelocity
btVector3FloatData m_interpolationLinearVelocity
Definition: btCollisionObject.h:635
btCollisionObjectDoubleData::m_collisionFilterGroup
int m_collisionFilterGroup
Definition: btCollisionObject.h:620
btCollisionObjectFloatData::m_rollingFriction
float m_rollingFriction
Definition: btCollisionObject.h:641
btCollisionObjectArray
btAlignedObjectArray< class btCollisionObject * > btCollisionObjectArray
Definition: btCollisionObject.h:30
btCollisionObjectFloatData::m_ccdSweptSphereRadius
float m_ccdSweptSphereRadius
Definition: btCollisionObject.h:646
btCollisionObject::m_activationState1
int m_activationState1
Definition: btCollisionObject.h:82
btCollisionObject::getRestitution
btScalar getRestitution() const
Definition: btCollisionObject.h:302
btCollisionObject::getInterpolationWorldTransform
btTransform & getInterpolationWorldTransform()
Definition: btCollisionObject.h:401
btCollisionObjectDoubleData::m_friction
double m_friction
Definition: btCollisionObject.h:605
btCollisionObject::getDeactivationTime
btScalar getDeactivationTime() const
Definition: btCollisionObject.h:283
btCollisionObject
btCollisionObject can be used to manage collision detection objects.
Definition: btCollisionObject.h:48
btCollisionObject::setUserPointer
void setUserPointer(void *userPointer)
users can point to their objects, userPointer is not used by Bullet
Definition: btCollisionObject.h:530
DISABLE_SIMULATION
#define DISABLE_SIMULATION
Definition: btCollisionObject.h:26
btCollisionObject::hasContactResponse
bool hasContactResponse() const
Definition: btCollisionObject.h:208
btCollisionObject::getInterpolationWorldTransform
const btTransform & getInterpolationWorldTransform() const
Definition: btCollisionObject.h:396
btCollisionObject::setUserIndex
void setUserIndex(int index)
users can point to their objects, userPointer is not used by Bullet
Definition: btCollisionObject.h:536
btCollisionObject::m_extensionPointer
void * m_extensionPointer
m_extensionPointer is used by some internal low-level Bullet extensions.
Definition: btCollisionObject.h:69
btCollisionObject::m_customDebugColorRGB
btVector3 m_customDebugColorRGB
Definition: btCollisionObject.h:121
btCollisionObjectFloatData::m_collisionFlags
int m_collisionFlags
Definition: btCollisionObject.h:649
btCollisionObject::m_contactProcessingThreshold
btScalar m_contactProcessingThreshold
Definition: btCollisionObject.h:64
btCollisionObject::calculateSerializeBufferSize
virtual int calculateSerializeBufferSize() const
Definition: btCollisionObject.h:661
btCollisionObject::setDeactivationTime
void setDeactivationTime(btScalar time)
Definition: btCollisionObject.h:279
btCollisionObject::setWorldTransform
void setWorldTransform(const btTransform &worldTrans)
Definition: btCollisionObject.h:375
btCollisionObject::setCompanionId
void setCompanionId(int id)
Definition: btCollisionObject.h:449
btCollisionObject::m_collisionFlags
int m_collisionFlags
Definition: btCollisionObject.h:76
btCollisionObjectDoubleData::m_rollingFriction
double m_rollingFriction
Definition: btCollisionObject.h:606
btCollisionObject::getWorldArrayIndex
int getWorldArrayIndex() const
Definition: btCollisionObject.h:454
btCollisionObject::m_updateRevision
int m_updateRevision
internal update revision number. It will be increased when the object changes. This allows some subsy...
Definition: btCollisionObject.h:119
btCollisionObject::getRollingFriction
btScalar getRollingFriction() const
Definition: btCollisionObject.h:321
btCollisionObject::getUserIndex
int getUserIndex() const
Definition: btCollisionObject.h:519
btCollisionObject::setInterpolationWorldTransform
void setInterpolationWorldTransform(const btTransform &trans)
Definition: btCollisionObject.h:406
btCollisionObject::getCollisionFlags
int getCollisionFlags() const
Definition: btCollisionObject.h:475
btCollisionObjectDoubleData::m_collisionFilterMask
int m_collisionFilterMask
Definition: btCollisionObject.h:621
btBroadphaseProxy
The btBroadphaseProxy is the main class that can be used with the Bullet broadphases.
Definition: btBroadphaseProxy.h:84
btCollisionObject::getContactProcessingThreshold
btScalar getContactProcessingThreshold() const
Definition: btCollisionObject.h:188
btCollisionObjectDoubleData::m_ccdMotionThreshold
double m_ccdMotionThreshold
Definition: btCollisionObject.h:612
btCollisionObject::internalGetExtensionPointer
void * internalGetExtensionPointer() const
Avoid using this internal API call, the extension pointer is used by some Bullet extensions.
Definition: btCollisionObject.h:264
btCollisionObject::setInterpolationAngularVelocity
void setInterpolationAngularVelocity(const btVector3 &angvel)
Definition: btCollisionObject.h:418
btCollisionObject::m_rollingFriction
btScalar m_rollingFriction
Definition: btCollisionObject.h:87
btCollisionObjectFloatData::m_checkCollideWith
int m_checkCollideWith
Definition: btCollisionObject.h:654
btVector3
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:80
ATTRIBUTE_ALIGNED16
#define ATTRIBUTE_ALIGNED16(a)
Definition: btScalar.h:84
btAlignedObjectArray::size
int size() const
return the number of elements in the array
Definition: btAlignedObjectArray.h:149
btCollisionObjectFloatData::m_internalType
int m_internalType
Definition: btCollisionObject.h:653
btCollisionObject::setAnisotropicFriction
void setAnisotropicFriction(const btVector3 &anisotropicFriction, int frictionMode=CF_ANISOTROPIC_FRICTION)
Definition: btCollisionObject.h:171
btCollisionObjectDoubleData::m_broadphaseHandle
void * m_broadphaseHandle
Definition: btCollisionObject.h:593
btTransform
The btTransform class supports rigid transforms with only translation and rotation and no scaling/she...
Definition: btTransform.h:28
btCollisionObjectDoubleData::m_islandTag1
int m_islandTag1
Definition: btCollisionObject.h:615
btMotionState.h
btCollisionObject::getCcdMotionThreshold
btScalar getCcdMotionThreshold() const
Definition: btCollisionObject.h:497
btCollisionObject::getCollisionShape
btCollisionShape * getCollisionShape()
Definition: btCollisionObject.h:229
btCollisionObjectDoubleData::m_uniqueId
int m_uniqueId
Definition: btCollisionObject.h:622
btCollisionObjectFloatData::m_companionId
int m_companionId
Definition: btCollisionObject.h:651
btCollisionObject::CollisionObjectTypes
CollisionObjectTypes
Definition: btCollisionObject.h:141
btCollisionObjectFloatData::m_friction
float m_friction
Definition: btCollisionObject.h:640
btCollisionObject::getIslandTag
int getIslandTag() const
Definition: btCollisionObject.h:434
btCollisionObject::setCollisionFlags
void setCollisionFlags(int flags)
Definition: btCollisionObject.h:480
btCollisionObject::setBroadphaseHandle
void setBroadphaseHandle(btBroadphaseProxy *handle)
Definition: btCollisionObject.h:391
btCollisionObject::getSpinningFriction
btScalar getSpinningFriction() const
Definition: btCollisionObject.h:330
btCollisionObjectFloatData::m_name
char * m_name
Definition: btCollisionObject.h:631
btCollisionObject::getHitFraction
btScalar getHitFraction() const
Definition: btCollisionObject.h:465
btCollisionObjectDoubleData::m_companionId
int m_companionId
Definition: btCollisionObject.h:616
btAlignedObjectArray::remove
void remove(const T &key)
Definition: btAlignedObjectArray.h:487
btCollisionObjectDoubleData::m_worldTransform
btTransformDoubleData m_worldTransform
Definition: btCollisionObject.h:598
btCollisionObjectFloatData::m_collisionFilterGroup
int m_collisionFilterGroup
Definition: btCollisionObject.h:655
btCollisionObjectDoubleData::m_interpolationWorldTransform
btTransformDoubleData m_interpolationWorldTransform
Definition: btCollisionObject.h:599
btCollisionObject::m_interpolationAngularVelocity
btVector3 m_interpolationAngularVelocity
Definition: btCollisionObject.h:60
btCollisionObjectFloatData::m_contactProcessingThreshold
float m_contactProcessingThreshold
Definition: btCollisionObject.h:638
btTransformFloatData
for serialization
Definition: btTransform.h:244
btCollisionObject::setIslandTag
void setIslandTag(int tag)
Definition: btCollisionObject.h:439
btCollisionObject::getInternalType
int getInternalType() const
reserved for Bullet internal usage
Definition: btCollisionObject.h:360
btCollisionObject::CollisionFlags
CollisionFlags
Definition: btCollisionObject.h:126
btCollisionObject::setRollingFriction
void setRollingFriction(btScalar frict)
Definition: btCollisionObject.h:316
BT_DECLARE_ALIGNED_ALLOCATOR
#define BT_DECLARE_ALIGNED_ALLOCATOR()
Definition: btScalar.h:405
btCollisionObjectDoubleData::m_interpolationLinearVelocity
btVector3DoubleData m_interpolationLinearVelocity
Definition: btCollisionObject.h:600
btCollisionObject::m_checkCollideWith
int m_checkCollideWith
If some object should have elaborate collision filtering by sub-classes.
Definition: btCollisionObject.h:114
btCollisionObject::internalSetExtensionPointer
void internalSetExtensionPointer(void *pointer)
Avoid using this internal API call, the extension pointer is used by some Bullet extensions If you ne...
Definition: btCollisionObject.h:270
btCollisionObject::getCustomDebugColor
bool getCustomDebugColor(btVector3 &colorRGB) const
Definition: btCollisionObject.h:562
btCollisionObjectFloatData::m_uniqueId
int m_uniqueId
Definition: btCollisionObject.h:657
btCollisionObject::m_contactStiffness
btScalar m_contactStiffness
Definition: btCollisionObject.h:90
btCollisionObject::m_userObjectPointer
void * m_userObjectPointer
users can point to their objects, m_userPointer is not used by Bullet, see setUserPointer/getUserPoin...
Definition: btCollisionObject.h:98
btCollisionObjectFloatData::m_broadphaseHandle
void * m_broadphaseHandle
Definition: btCollisionObject.h:628
btCollisionObjectFloatData::m_contactDamping
float m_contactDamping
Definition: btCollisionObject.h:642
btCollisionObject::m_restitution
btScalar m_restitution
Definition: btCollisionObject.h:86
btCollisionObject::setInterpolationLinearVelocity
void setInterpolationLinearVelocity(const btVector3 &linvel)
Definition: btCollisionObject.h:412
btAlignedObjectArray.h
btCollisionObjectDoubleData::m_deactivationTime
double m_deactivationTime
Definition: btCollisionObject.h:604
btCollisionObject::m_islandTag1
int m_islandTag1
Definition: btCollisionObject.h:78
btCollisionObjectDoubleData::m_collisionShape
void * m_collisionShape
Definition: btCollisionObject.h:594
btCollisionObject::isActive
bool isActive() const
Definition: btCollisionObject.h:292
btVector3FloatData
Definition: btVector3.h:1281
btCollisionObject::hasAnisotropicFriction
bool hasAnisotropicFriction(int frictionMode=CF_ANISOTROPIC_FRICTION) const
Definition: btCollisionObject.h:177
btCollisionObject::m_broadphaseHandle
btBroadphaseProxy * m_broadphaseHandle
Definition: btCollisionObject.h:66
btCollisionObjectDoubleData::m_contactDamping
double m_contactDamping
Definition: btCollisionObject.h:607
btCollisionObject::getCcdSweptSphereRadius
btScalar getCcdSweptSphereRadius() const
Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm::
Definition: btCollisionObject.h:486
btCollisionObjectDoubleData::m_restitution
double m_restitution
Definition: btCollisionObject.h:609
btCollisionObject::m_interpolationLinearVelocity
btVector3 m_interpolationLinearVelocity
Definition: btCollisionObject.h:59
btCollisionObject::setContactProcessingThreshold
void setContactProcessingThreshold(btScalar contactProcessingThreshold)
the constraint solver can discard solving contacts, if the distance is above this threshold...
Definition: btCollisionObject.h:184
btCollisionObjectFloatData::m_collisionFilterMask
int m_collisionFilterMask
Definition: btCollisionObject.h:656
btCollisionObject::getFriction
btScalar getFriction() const
Definition: btCollisionObject.h:311
btCollisionObjectFloatData::m_interpolationAngularVelocity
btVector3FloatData m_interpolationAngularVelocity
Definition: btCollisionObject.h:636
btTransformDoubleData
Definition: btTransform.h:250
btCollisionShapeData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
Definition: btCollisionShape.h:151
btCollisionObject::m_friction
btScalar m_friction
Definition: btCollisionObject.h:85
btCollisionObject::getCompanionId
int getCompanionId() const
Definition: btCollisionObject.h:444
btCollisionObjectFloatData::m_activationState1
int m_activationState1
Definition: btCollisionObject.h:652
btCollisionObject::checkCollideWithOverride
virtual bool checkCollideWithOverride(const btCollisionObject *co) const
Definition: btCollisionObject.h:252
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:294
btCollisionObject::getCollisionShape
const btCollisionShape * getCollisionShape() const
Definition: btCollisionObject.h:224
btVector3DoubleData
Definition: btVector3.h:1286
btCollisionObject::m_userIndex
int m_userIndex
Definition: btCollisionObject.h:102
btCollisionObject::getUserPointer
void * getUserPointer() const
users can point to their objects, userPointer is not used by Bullet
Definition: btCollisionObject.h:514
btCollisionObject::getUpdateRevisionInternal
int getUpdateRevisionInternal() const
Definition: btCollisionObject.h:546
btCollisionObjectDoubleData::m_activationState1
int m_activationState1
Definition: btCollisionObject.h:617
btCollisionObjectFloatData::m_contactStiffness
float m_contactStiffness
Definition: btCollisionObject.h:643