b3Collidable.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef B3_COLLIDABLE_H
  2. #define B3_COLLIDABLE_H
  3. #include "Bullet3Common/shared/b3Float4.h"
  4. #include "Bullet3Common/shared/b3Quat.h"
  5. enum b3ShapeTypes
  6. {
  7. SHAPE_HEIGHT_FIELD = 1,
  8. SHAPE_CONVEX_HULL = 3,
  9. SHAPE_PLANE = 4,
  10. SHAPE_CONCAVE_TRIMESH = 5,
  11. SHAPE_COMPOUND_OF_CONVEX_HULLS = 6,
  12. SHAPE_SPHERE = 7,
  13. MAX_NUM_SHAPE_TYPES,
  14. };
  15. typedef struct b3Collidable b3Collidable_t;
  16. struct b3Collidable
  17. {
  18. union {
  19. int m_numChildShapes;
  20. int m_bvhIndex;
  21. };
  22. union {
  23. float m_radius;
  24. int m_compoundBvhIndex;
  25. };
  26. int m_shapeType;
  27. union {
  28. int m_shapeIndex;
  29. float m_height;
  30. };
  31. };
  32. typedef struct b3GpuChildShape b3GpuChildShape_t;
  33. struct b3GpuChildShape
  34. {
  35. b3Float4 m_childPosition;
  36. b3Quat m_childOrientation;
  37. union {
  38. int m_shapeIndex; //used for SHAPE_COMPOUND_OF_CONVEX_HULLS
  39. int m_capsuleAxis;
  40. };
  41. union {
  42. float m_radius; //used for childshape of SHAPE_COMPOUND_OF_SPHERES or SHAPE_COMPOUND_OF_CAPSULES
  43. int m_numChildShapes; //used for compound shape
  44. };
  45. union {
  46. float m_height; //used for childshape of SHAPE_COMPOUND_OF_CAPSULES
  47. int m_collidableShapeIndex;
  48. };
  49. int m_shapeType;
  50. };
  51. struct b3CompoundOverlappingPair
  52. {
  53. int m_bodyIndexA;
  54. int m_bodyIndexB;
  55. // int m_pairType;
  56. int m_childShapeIndexA;
  57. int m_childShapeIndexB;
  58. };
  59. #endif //B3_COLLIDABLE_H