btCollisionObject.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691
  1. /*
  2. Bullet Continuous Collision Detection and Physics Library
  3. Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
  4. This software is provided 'as-is', without any express or implied warranty.
  5. In no event will the authors be held liable for any damages arising from the use of this software.
  6. Permission is granted to anyone to use this software for any purpose,
  7. including commercial applications, and to alter it and redistribute it freely,
  8. subject to the following restrictions:
  9. 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.
  10. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  11. 3. This notice may not be removed or altered from any source distribution.
  12. */
  13. #ifndef BT_COLLISION_OBJECT_H
  14. #define BT_COLLISION_OBJECT_H
  15. #include "LinearMath/btTransform.h"
  16. //island management, m_activationState1
  17. #define ACTIVE_TAG 1
  18. #define ISLAND_SLEEPING 2
  19. #define WANTS_DEACTIVATION 3
  20. #define DISABLE_DEACTIVATION 4
  21. #define DISABLE_SIMULATION 5
  22. #define FIXED_BASE_MULTI_BODY 6
  23. struct btBroadphaseProxy;
  24. class btCollisionShape;
  25. struct btCollisionShapeData;
  26. #include "LinearMath/btMotionState.h"
  27. #include "LinearMath/btAlignedAllocator.h"
  28. #include "LinearMath/btAlignedObjectArray.h"
  29. typedef btAlignedObjectArray<class btCollisionObject*> btCollisionObjectArray;
  30. #ifdef BT_USE_DOUBLE_PRECISION
  31. #define btCollisionObjectData btCollisionObjectDoubleData
  32. #define btCollisionObjectDataName "btCollisionObjectDoubleData"
  33. #else
  34. #define btCollisionObjectData btCollisionObjectFloatData
  35. #define btCollisionObjectDataName "btCollisionObjectFloatData"
  36. #endif
  37. /// btCollisionObject can be used to manage collision detection objects.
  38. /// btCollisionObject maintains all information that is needed for a collision detection: Shape, Transform and AABB proxy.
  39. /// They can be added to the btCollisionWorld.
  40. ATTRIBUTE_ALIGNED16(class)
  41. btCollisionObject
  42. {
  43. protected:
  44. btTransform m_worldTransform;
  45. ///m_interpolationWorldTransform is used for CCD and interpolation
  46. ///it can be either previous or future (predicted) transform
  47. btTransform m_interpolationWorldTransform;
  48. //those two are experimental: just added for bullet time effect, so you can still apply impulses (directly modifying velocities)
  49. //without destroying the continuous interpolated motion (which uses this interpolation velocities)
  50. btVector3 m_interpolationLinearVelocity;
  51. btVector3 m_interpolationAngularVelocity;
  52. btVector3 m_anisotropicFriction;
  53. int m_hasAnisotropicFriction;
  54. btScalar m_contactProcessingThreshold;
  55. btBroadphaseProxy* m_broadphaseHandle;
  56. btCollisionShape* m_collisionShape;
  57. ///m_extensionPointer is used by some internal low-level Bullet extensions.
  58. void* m_extensionPointer;
  59. ///m_rootCollisionShape is temporarily used to store the original collision shape
  60. ///The m_collisionShape might be temporarily replaced by a child collision shape during collision detection purposes
  61. ///If it is NULL, the m_collisionShape is not temporarily replaced.
  62. btCollisionShape* m_rootCollisionShape;
  63. int m_collisionFlags;
  64. int m_islandTag1;
  65. int m_companionId;
  66. int m_worldArrayIndex; // index of object in world's collisionObjects array
  67. mutable int m_activationState1;
  68. mutable btScalar m_deactivationTime;
  69. btScalar m_friction;
  70. btScalar m_restitution;
  71. btScalar m_rollingFriction; //torsional friction orthogonal to contact normal (useful to stop spheres rolling forever)
  72. btScalar m_spinningFriction; // torsional friction around the contact normal (useful for grasping)
  73. btScalar m_contactDamping;
  74. btScalar m_contactStiffness;
  75. ///m_internalType is reserved to distinguish Bullet's btCollisionObject, btRigidBody, btSoftBody, btGhostObject etc.
  76. ///do not assign your own m_internalType unless you write a new dynamics object class.
  77. int m_internalType;
  78. ///users can point to their objects, m_userPointer is not used by Bullet, see setUserPointer/getUserPointer
  79. void* m_userObjectPointer;
  80. int m_userIndex2;
  81. int m_userIndex;
  82. int m_userIndex3;
  83. ///time of impact calculation
  84. btScalar m_hitFraction;
  85. ///Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm::
  86. btScalar m_ccdSweptSphereRadius;
  87. /// Don't do continuous collision detection if the motion (in one step) is less then m_ccdMotionThreshold
  88. btScalar m_ccdMotionThreshold;
  89. /// If some object should have elaborate collision filtering by sub-classes
  90. int m_checkCollideWith;
  91. btAlignedObjectArray<const btCollisionObject*> m_objectsWithoutCollisionCheck;
  92. ///internal update revision number. It will be increased when the object changes. This allows some subsystems to perform lazy evaluation.
  93. int m_updateRevision;
  94. btVector3 m_customDebugColorRGB;
  95. public:
  96. BT_DECLARE_ALIGNED_ALLOCATOR();
  97. enum CollisionFlags
  98. {
  99. CF_DYNAMIC_OBJECT = 0,
  100. CF_STATIC_OBJECT = 1,
  101. CF_KINEMATIC_OBJECT = 2,
  102. CF_NO_CONTACT_RESPONSE = 4,
  103. CF_CUSTOM_MATERIAL_CALLBACK = 8, //this allows per-triangle material (friction/restitution)
  104. CF_CHARACTER_OBJECT = 16,
  105. CF_DISABLE_VISUALIZE_OBJECT = 32, //disable debug drawing
  106. CF_DISABLE_SPU_COLLISION_PROCESSING = 64, //disable parallel/SPU processing
  107. CF_HAS_CONTACT_STIFFNESS_DAMPING = 128,
  108. CF_HAS_CUSTOM_DEBUG_RENDERING_COLOR = 256,
  109. CF_HAS_FRICTION_ANCHOR = 512,
  110. CF_HAS_COLLISION_SOUND_TRIGGER = 1024
  111. };
  112. enum CollisionObjectTypes
  113. {
  114. CO_COLLISION_OBJECT = 1,
  115. CO_RIGID_BODY = 2,
  116. ///CO_GHOST_OBJECT keeps track of all objects overlapping its AABB and that pass its collision filter
  117. ///It is useful for collision sensors, explosion objects, character controller etc.
  118. CO_GHOST_OBJECT = 4,
  119. CO_SOFT_BODY = 8,
  120. CO_HF_FLUID = 16,
  121. CO_USER_TYPE = 32,
  122. CO_FEATHERSTONE_LINK = 64
  123. };
  124. enum AnisotropicFrictionFlags
  125. {
  126. CF_ANISOTROPIC_FRICTION_DISABLED = 0,
  127. CF_ANISOTROPIC_FRICTION = 1,
  128. CF_ANISOTROPIC_ROLLING_FRICTION = 2
  129. };
  130. SIMD_FORCE_INLINE bool mergesSimulationIslands() const
  131. {
  132. ///static objects, kinematic and object without contact response don't merge islands
  133. return ((m_collisionFlags & (CF_STATIC_OBJECT | CF_KINEMATIC_OBJECT | CF_NO_CONTACT_RESPONSE)) == 0);
  134. }
  135. const btVector3& getAnisotropicFriction() const
  136. {
  137. return m_anisotropicFriction;
  138. }
  139. void setAnisotropicFriction(const btVector3& anisotropicFriction, int frictionMode = CF_ANISOTROPIC_FRICTION)
  140. {
  141. m_anisotropicFriction = anisotropicFriction;
  142. bool isUnity = (anisotropicFriction[0] != 1.f) || (anisotropicFriction[1] != 1.f) || (anisotropicFriction[2] != 1.f);
  143. m_hasAnisotropicFriction = isUnity ? frictionMode : 0;
  144. }
  145. bool hasAnisotropicFriction(int frictionMode = CF_ANISOTROPIC_FRICTION) const
  146. {
  147. return (m_hasAnisotropicFriction & frictionMode) != 0;
  148. }
  149. ///the constraint solver can discard solving contacts, if the distance is above this threshold. 0 by default.
  150. ///Note that using contacts with positive distance can improve stability. It increases, however, the chance of colliding with degerate contacts, such as 'interior' triangle edges
  151. void setContactProcessingThreshold(btScalar contactProcessingThreshold)
  152. {
  153. m_contactProcessingThreshold = contactProcessingThreshold;
  154. }
  155. btScalar getContactProcessingThreshold() const
  156. {
  157. return m_contactProcessingThreshold;
  158. }
  159. SIMD_FORCE_INLINE bool isStaticObject() const
  160. {
  161. return (m_collisionFlags & CF_STATIC_OBJECT) != 0;
  162. }
  163. SIMD_FORCE_INLINE bool isKinematicObject() const
  164. {
  165. return (m_collisionFlags & CF_KINEMATIC_OBJECT) != 0;
  166. }
  167. SIMD_FORCE_INLINE bool isStaticOrKinematicObject() const
  168. {
  169. return (m_collisionFlags & (CF_KINEMATIC_OBJECT | CF_STATIC_OBJECT)) != 0;
  170. }
  171. SIMD_FORCE_INLINE bool hasContactResponse() const
  172. {
  173. return (m_collisionFlags & CF_NO_CONTACT_RESPONSE) == 0;
  174. }
  175. btCollisionObject();
  176. virtual ~btCollisionObject();
  177. virtual void setCollisionShape(btCollisionShape * collisionShape)
  178. {
  179. m_updateRevision++;
  180. m_collisionShape = collisionShape;
  181. m_rootCollisionShape = collisionShape;
  182. }
  183. SIMD_FORCE_INLINE const btCollisionShape* getCollisionShape() const
  184. {
  185. return m_collisionShape;
  186. }
  187. SIMD_FORCE_INLINE btCollisionShape* getCollisionShape()
  188. {
  189. return m_collisionShape;
  190. }
  191. void setIgnoreCollisionCheck(const btCollisionObject* co, bool ignoreCollisionCheck)
  192. {
  193. if (ignoreCollisionCheck)
  194. {
  195. //We don't check for duplicates. Is it ok to leave that up to the user of this API?
  196. //int index = m_objectsWithoutCollisionCheck.findLinearSearch(co);
  197. //if (index == m_objectsWithoutCollisionCheck.size())
  198. //{
  199. m_objectsWithoutCollisionCheck.push_back(co);
  200. //}
  201. }
  202. else
  203. {
  204. m_objectsWithoutCollisionCheck.remove(co);
  205. }
  206. m_checkCollideWith = m_objectsWithoutCollisionCheck.size() > 0;
  207. }
  208. int getNumObjectsWithoutCollision() const
  209. {
  210. return m_objectsWithoutCollisionCheck.size();
  211. }
  212. const btCollisionObject* getObjectWithoutCollision(int index)
  213. {
  214. return m_objectsWithoutCollisionCheck[index];
  215. }
  216. virtual bool checkCollideWithOverride(const btCollisionObject* co) const
  217. {
  218. int index = m_objectsWithoutCollisionCheck.findLinearSearch(co);
  219. if (index < m_objectsWithoutCollisionCheck.size())
  220. {
  221. return false;
  222. }
  223. return true;
  224. }
  225. ///Avoid using this internal API call, the extension pointer is used by some Bullet extensions.
  226. ///If you need to store your own user pointer, use 'setUserPointer/getUserPointer' instead.
  227. void* internalGetExtensionPointer() const
  228. {
  229. return m_extensionPointer;
  230. }
  231. ///Avoid using this internal API call, the extension pointer is used by some Bullet extensions
  232. ///If you need to store your own user pointer, use 'setUserPointer/getUserPointer' instead.
  233. void internalSetExtensionPointer(void* pointer)
  234. {
  235. m_extensionPointer = pointer;
  236. }
  237. SIMD_FORCE_INLINE int getActivationState() const { return m_activationState1; }
  238. void setActivationState(int newState) const;
  239. void setDeactivationTime(btScalar time)
  240. {
  241. m_deactivationTime = time;
  242. }
  243. btScalar getDeactivationTime() const
  244. {
  245. return m_deactivationTime;
  246. }
  247. void forceActivationState(int newState) const;
  248. void activate(bool forceActivation = false) const;
  249. SIMD_FORCE_INLINE bool isActive() const
  250. {
  251. return ((getActivationState() != FIXED_BASE_MULTI_BODY) && (getActivationState() != ISLAND_SLEEPING) && (getActivationState() != DISABLE_SIMULATION));
  252. }
  253. void setRestitution(btScalar rest)
  254. {
  255. m_updateRevision++;
  256. m_restitution = rest;
  257. }
  258. btScalar getRestitution() const
  259. {
  260. return m_restitution;
  261. }
  262. void setFriction(btScalar frict)
  263. {
  264. m_updateRevision++;
  265. m_friction = frict;
  266. }
  267. btScalar getFriction() const
  268. {
  269. return m_friction;
  270. }
  271. void setRollingFriction(btScalar frict)
  272. {
  273. m_updateRevision++;
  274. m_rollingFriction = frict;
  275. }
  276. btScalar getRollingFriction() const
  277. {
  278. return m_rollingFriction;
  279. }
  280. void setSpinningFriction(btScalar frict)
  281. {
  282. m_updateRevision++;
  283. m_spinningFriction = frict;
  284. }
  285. btScalar getSpinningFriction() const
  286. {
  287. return m_spinningFriction;
  288. }
  289. void setContactStiffnessAndDamping(btScalar stiffness, btScalar damping)
  290. {
  291. m_updateRevision++;
  292. m_contactStiffness = stiffness;
  293. m_contactDamping = damping;
  294. m_collisionFlags |= CF_HAS_CONTACT_STIFFNESS_DAMPING;
  295. //avoid divisions by zero...
  296. if (m_contactStiffness < SIMD_EPSILON)
  297. {
  298. m_contactStiffness = SIMD_EPSILON;
  299. }
  300. }
  301. btScalar getContactStiffness() const
  302. {
  303. return m_contactStiffness;
  304. }
  305. btScalar getContactDamping() const
  306. {
  307. return m_contactDamping;
  308. }
  309. ///reserved for Bullet internal usage
  310. int getInternalType() const
  311. {
  312. return m_internalType;
  313. }
  314. btTransform& getWorldTransform()
  315. {
  316. return m_worldTransform;
  317. }
  318. const btTransform& getWorldTransform() const
  319. {
  320. return m_worldTransform;
  321. }
  322. void setWorldTransform(const btTransform& worldTrans)
  323. {
  324. m_updateRevision++;
  325. m_worldTransform = worldTrans;
  326. }
  327. SIMD_FORCE_INLINE btBroadphaseProxy* getBroadphaseHandle()
  328. {
  329. return m_broadphaseHandle;
  330. }
  331. SIMD_FORCE_INLINE const btBroadphaseProxy* getBroadphaseHandle() const
  332. {
  333. return m_broadphaseHandle;
  334. }
  335. void setBroadphaseHandle(btBroadphaseProxy * handle)
  336. {
  337. m_broadphaseHandle = handle;
  338. }
  339. const btTransform& getInterpolationWorldTransform() const
  340. {
  341. return m_interpolationWorldTransform;
  342. }
  343. btTransform& getInterpolationWorldTransform()
  344. {
  345. return m_interpolationWorldTransform;
  346. }
  347. void setInterpolationWorldTransform(const btTransform& trans)
  348. {
  349. m_updateRevision++;
  350. m_interpolationWorldTransform = trans;
  351. }
  352. void setInterpolationLinearVelocity(const btVector3& linvel)
  353. {
  354. m_updateRevision++;
  355. m_interpolationLinearVelocity = linvel;
  356. }
  357. void setInterpolationAngularVelocity(const btVector3& angvel)
  358. {
  359. m_updateRevision++;
  360. m_interpolationAngularVelocity = angvel;
  361. }
  362. const btVector3& getInterpolationLinearVelocity() const
  363. {
  364. return m_interpolationLinearVelocity;
  365. }
  366. const btVector3& getInterpolationAngularVelocity() const
  367. {
  368. return m_interpolationAngularVelocity;
  369. }
  370. SIMD_FORCE_INLINE int getIslandTag() const
  371. {
  372. return m_islandTag1;
  373. }
  374. void setIslandTag(int tag)
  375. {
  376. m_islandTag1 = tag;
  377. }
  378. SIMD_FORCE_INLINE int getCompanionId() const
  379. {
  380. return m_companionId;
  381. }
  382. void setCompanionId(int id)
  383. {
  384. m_companionId = id;
  385. }
  386. SIMD_FORCE_INLINE int getWorldArrayIndex() const
  387. {
  388. return m_worldArrayIndex;
  389. }
  390. // only should be called by CollisionWorld
  391. void setWorldArrayIndex(int ix)
  392. {
  393. m_worldArrayIndex = ix;
  394. }
  395. SIMD_FORCE_INLINE btScalar getHitFraction() const
  396. {
  397. return m_hitFraction;
  398. }
  399. void setHitFraction(btScalar hitFraction)
  400. {
  401. m_hitFraction = hitFraction;
  402. }
  403. SIMD_FORCE_INLINE int getCollisionFlags() const
  404. {
  405. return m_collisionFlags;
  406. }
  407. void setCollisionFlags(int flags)
  408. {
  409. m_collisionFlags = flags;
  410. }
  411. ///Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm::
  412. btScalar getCcdSweptSphereRadius() const
  413. {
  414. return m_ccdSweptSphereRadius;
  415. }
  416. ///Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm::
  417. void setCcdSweptSphereRadius(btScalar radius)
  418. {
  419. m_ccdSweptSphereRadius = radius;
  420. }
  421. btScalar getCcdMotionThreshold() const
  422. {
  423. return m_ccdMotionThreshold;
  424. }
  425. btScalar getCcdSquareMotionThreshold() const
  426. {
  427. return m_ccdMotionThreshold * m_ccdMotionThreshold;
  428. }
  429. /// Don't do continuous collision detection if the motion (in one step) is less then m_ccdMotionThreshold
  430. void setCcdMotionThreshold(btScalar ccdMotionThreshold)
  431. {
  432. m_ccdMotionThreshold = ccdMotionThreshold;
  433. }
  434. ///users can point to their objects, userPointer is not used by Bullet
  435. void* getUserPointer() const
  436. {
  437. return m_userObjectPointer;
  438. }
  439. int getUserIndex() const
  440. {
  441. return m_userIndex;
  442. }
  443. int getUserIndex2() const
  444. {
  445. return m_userIndex2;
  446. }
  447. int getUserIndex3() const
  448. {
  449. return m_userIndex3;
  450. }
  451. ///users can point to their objects, userPointer is not used by Bullet
  452. void setUserPointer(void* userPointer)
  453. {
  454. m_userObjectPointer = userPointer;
  455. }
  456. ///users can point to their objects, userPointer is not used by Bullet
  457. void setUserIndex(int index)
  458. {
  459. m_userIndex = index;
  460. }
  461. void setUserIndex2(int index)
  462. {
  463. m_userIndex2 = index;
  464. }
  465. void setUserIndex3(int index)
  466. {
  467. m_userIndex3 = index;
  468. }
  469. int getUpdateRevisionInternal() const
  470. {
  471. return m_updateRevision;
  472. }
  473. void setCustomDebugColor(const btVector3& colorRGB)
  474. {
  475. m_customDebugColorRGB = colorRGB;
  476. m_collisionFlags |= CF_HAS_CUSTOM_DEBUG_RENDERING_COLOR;
  477. }
  478. void removeCustomDebugColor()
  479. {
  480. m_collisionFlags &= ~CF_HAS_CUSTOM_DEBUG_RENDERING_COLOR;
  481. }
  482. bool getCustomDebugColor(btVector3 & colorRGB) const
  483. {
  484. bool hasCustomColor = (0 != (m_collisionFlags & CF_HAS_CUSTOM_DEBUG_RENDERING_COLOR));
  485. if (hasCustomColor)
  486. {
  487. colorRGB = m_customDebugColorRGB;
  488. }
  489. return hasCustomColor;
  490. }
  491. inline bool checkCollideWith(const btCollisionObject* co) const
  492. {
  493. if (m_checkCollideWith)
  494. return checkCollideWithOverride(co);
  495. return true;
  496. }
  497. virtual int calculateSerializeBufferSize() const;
  498. ///fills the dataBuffer and returns the struct name (and 0 on failure)
  499. virtual const char* serialize(void* dataBuffer, class btSerializer* serializer) const;
  500. virtual void serializeSingleObject(class btSerializer * serializer) const;
  501. };
  502. // clang-format off
  503. ///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
  504. struct btCollisionObjectDoubleData
  505. {
  506. void *m_broadphaseHandle;
  507. void *m_collisionShape;
  508. btCollisionShapeData *m_rootCollisionShape;
  509. char *m_name;
  510. btTransformDoubleData m_worldTransform;
  511. btTransformDoubleData m_interpolationWorldTransform;
  512. btVector3DoubleData m_interpolationLinearVelocity;
  513. btVector3DoubleData m_interpolationAngularVelocity;
  514. btVector3DoubleData m_anisotropicFriction;
  515. double m_contactProcessingThreshold;
  516. double m_deactivationTime;
  517. double m_friction;
  518. double m_rollingFriction;
  519. double m_contactDamping;
  520. double m_contactStiffness;
  521. double m_restitution;
  522. double m_hitFraction;
  523. double m_ccdSweptSphereRadius;
  524. double m_ccdMotionThreshold;
  525. int m_hasAnisotropicFriction;
  526. int m_collisionFlags;
  527. int m_islandTag1;
  528. int m_companionId;
  529. int m_activationState1;
  530. int m_internalType;
  531. int m_checkCollideWith;
  532. int m_collisionFilterGroup;
  533. int m_collisionFilterMask;
  534. int m_uniqueId;//m_uniqueId is introduced for paircache. could get rid of this, by calculating the address offset etc.
  535. };
  536. ///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
  537. struct btCollisionObjectFloatData
  538. {
  539. void *m_broadphaseHandle;
  540. void *m_collisionShape;
  541. btCollisionShapeData *m_rootCollisionShape;
  542. char *m_name;
  543. btTransformFloatData m_worldTransform;
  544. btTransformFloatData m_interpolationWorldTransform;
  545. btVector3FloatData m_interpolationLinearVelocity;
  546. btVector3FloatData m_interpolationAngularVelocity;
  547. btVector3FloatData m_anisotropicFriction;
  548. float m_contactProcessingThreshold;
  549. float m_deactivationTime;
  550. float m_friction;
  551. float m_rollingFriction;
  552. float m_contactDamping;
  553. float m_contactStiffness;
  554. float m_restitution;
  555. float m_hitFraction;
  556. float m_ccdSweptSphereRadius;
  557. float m_ccdMotionThreshold;
  558. int m_hasAnisotropicFriction;
  559. int m_collisionFlags;
  560. int m_islandTag1;
  561. int m_companionId;
  562. int m_activationState1;
  563. int m_internalType;
  564. int m_checkCollideWith;
  565. int m_collisionFilterGroup;
  566. int m_collisionFilterMask;
  567. int m_uniqueId;
  568. };
  569. // clang-format on
  570. SIMD_FORCE_INLINE int btCollisionObject::calculateSerializeBufferSize() const
  571. {
  572. return sizeof(btCollisionObjectData);
  573. }
  574. #endif //BT_COLLISION_OBJECT_H