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