Changeset 8284 for code/branches/kicklib2/src/external/bullet/BulletCollision/CollisionDispatch/btCollisionObject.h
- Timestamp:
- Apr 21, 2011, 6:58:23 PM (14 years ago)
- Location:
- code/branches/kicklib2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/kicklib2
- Property svn:mergeinfo changed
-
code/branches/kicklib2/src/external/bullet/BulletCollision/CollisionDispatch/btCollisionObject.h
r5781 r8284 28 28 struct btBroadphaseProxy; 29 29 class btCollisionShape; 30 struct btCollisionShapeData; 30 31 #include "LinearMath/btMotionState.h" 31 32 #include "LinearMath/btAlignedAllocator.h" 32 33 #include "LinearMath/btAlignedObjectArray.h" 33 34 34 35 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 36 44 37 45 … … 54 62 btVector3 m_interpolationAngularVelocity; 55 63 56 btVector3 57 boolm_hasAnisotropicFriction;58 btScalar 64 btVector3 m_anisotropicFriction; 65 int m_hasAnisotropicFriction; 66 btScalar m_contactProcessingThreshold; 59 67 60 68 btBroadphaseProxy* m_broadphaseHandle; 61 69 btCollisionShape* m_collisionShape; 70 ///m_extensionPointer is used by some internal low-level Bullet extensions. 71 void* m_extensionPointer; 62 72 63 73 ///m_rootCollisionShape is temporarily used to store the original collision shape … … 77 87 btScalar m_restitution; 78 88 79 ///users can point to their objects, m_userPointer is not used by Bullet, see setUserPointer/getUserPointer80 void* m_userObjectPointer;81 82 89 ///m_internalType is reserved to distinguish Bullet's btCollisionObject, btRigidBody, btSoftBody, btGhostObject etc. 83 90 ///do not assign your own m_internalType unless you write a new dynamics object class. 84 91 int m_internalType; 85 92 93 ///users can point to their objects, m_userPointer is not used by Bullet, see setUserPointer/getUserPointer 94 void* m_userObjectPointer; 95 86 96 ///time of impact calculation 87 97 btScalar m_hitFraction; … … 94 104 95 105 /// If some object should have elaborate collision filtering by sub-classes 96 bool m_checkCollideWith; 97 98 char m_pad[7]; 106 int m_checkCollideWith; 99 107 100 108 virtual bool checkCollideWithOverride(btCollisionObject* /* co */) … … 113 121 CF_NO_CONTACT_RESPONSE = 4, 114 122 CF_CUSTOM_MATERIAL_CALLBACK = 8,//this allows per-triangle material (friction/restitution) 115 CF_CHARACTER_OBJECT = 16 123 CF_CHARACTER_OBJECT = 16, 124 CF_DISABLE_VISUALIZE_OBJECT = 32, //disable debug drawing 125 CF_DISABLE_SPU_COLLISION_PROCESSING = 64//disable parallel/SPU processing 116 126 }; 117 127 … … 119 129 { 120 130 CO_COLLISION_OBJECT =1, 121 CO_RIGID_BODY ,131 CO_RIGID_BODY=2, 122 132 ///CO_GHOST_OBJECT keeps track of all objects overlapping its AABB and that pass its collision filter 123 133 ///It is useful for collision sensors, explosion objects, character controller etc. 124 CO_GHOST_OBJECT, 125 CO_SOFT_BODY, 126 CO_HF_FLUID 134 CO_GHOST_OBJECT=4, 135 CO_SOFT_BODY=8, 136 CO_HF_FLUID=16, 137 CO_USER_TYPE=32 127 138 }; 128 139 … … 144 155 bool hasAnisotropicFriction() const 145 156 { 146 return m_hasAnisotropicFriction ;157 return m_hasAnisotropicFriction!=0; 147 158 } 148 159 … … 214 225 } 215 226 227 ///Avoid using this internal API call, the extension pointer is used by some Bullet extensions. 228 ///If you need to store your own user pointer, use 'setUserPointer/getUserPointer' instead. 229 void* internalGetExtensionPointer() const 230 { 231 return m_extensionPointer; 232 } 233 ///Avoid using this internal API call, the extension pointer is used by some Bullet extensions 234 ///If you need to store your own user pointer, use 'setUserPointer/getUserPointer' instead. 235 void internalSetExtensionPointer(void* pointer) 236 { 237 m_extensionPointer = pointer; 238 } 239 216 240 SIMD_FORCE_INLINE int getActivationState() const { return m_activationState1;} 217 241 … … 394 418 void setCcdMotionThreshold(btScalar ccdMotionThreshold) 395 419 { 396 m_ccdMotionThreshold = ccdMotionThreshold *ccdMotionThreshold;420 m_ccdMotionThreshold = ccdMotionThreshold; 397 421 } 398 422 … … 417 441 return true; 418 442 } 443 444 virtual int calculateSerializeBufferSize() const; 445 446 ///fills the dataBuffer and returns the struct name (and 0 on failure) 447 virtual const char* serialize(void* dataBuffer, class btSerializer* serializer) const; 448 449 virtual void serializeSingleObject(class btSerializer* serializer) const; 450 419 451 }; 420 452 453 ///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 454 struct btCollisionObjectDoubleData 455 { 456 void *m_broadphaseHandle; 457 void *m_collisionShape; 458 btCollisionShapeData *m_rootCollisionShape; 459 char *m_name; 460 461 btTransformDoubleData m_worldTransform; 462 btTransformDoubleData m_interpolationWorldTransform; 463 btVector3DoubleData m_interpolationLinearVelocity; 464 btVector3DoubleData m_interpolationAngularVelocity; 465 btVector3DoubleData m_anisotropicFriction; 466 double m_contactProcessingThreshold; 467 double m_deactivationTime; 468 double m_friction; 469 double m_restitution; 470 double m_hitFraction; 471 double m_ccdSweptSphereRadius; 472 double m_ccdMotionThreshold; 473 474 int m_hasAnisotropicFriction; 475 int m_collisionFlags; 476 int m_islandTag1; 477 int m_companionId; 478 int m_activationState1; 479 int m_internalType; 480 int m_checkCollideWith; 481 482 char m_padding[4]; 483 }; 484 485 ///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 486 struct btCollisionObjectFloatData 487 { 488 void *m_broadphaseHandle; 489 void *m_collisionShape; 490 btCollisionShapeData *m_rootCollisionShape; 491 char *m_name; 492 493 btTransformFloatData m_worldTransform; 494 btTransformFloatData m_interpolationWorldTransform; 495 btVector3FloatData m_interpolationLinearVelocity; 496 btVector3FloatData m_interpolationAngularVelocity; 497 btVector3FloatData m_anisotropicFriction; 498 float m_contactProcessingThreshold; 499 float m_deactivationTime; 500 float m_friction; 501 float m_restitution; 502 float m_hitFraction; 503 float m_ccdSweptSphereRadius; 504 float m_ccdMotionThreshold; 505 506 int m_hasAnisotropicFriction; 507 int m_collisionFlags; 508 int m_islandTag1; 509 int m_companionId; 510 int m_activationState1; 511 int m_internalType; 512 int m_checkCollideWith; 513 }; 514 515 516 517 SIMD_FORCE_INLINE int btCollisionObject::calculateSerializeBufferSize() const 518 { 519 return sizeof(btCollisionObjectData); 520 } 521 522 523 421 524 #endif //COLLISION_OBJECT_H
Note: See TracChangeset
for help on using the changeset viewer.