2017-08-01 14:30:58 +02:00
|
|
|
|
|
|
|
#ifndef B3_COLLIDABLE_H
|
|
|
|
#define B3_COLLIDABLE_H
|
|
|
|
|
|
|
|
#include "Bullet3Common/shared/b3Float4.h"
|
|
|
|
#include "Bullet3Common/shared/b3Quat.h"
|
|
|
|
|
|
|
|
enum b3ShapeTypes
|
|
|
|
{
|
2019-01-03 14:26:51 +01:00
|
|
|
SHAPE_HEIGHT_FIELD = 1,
|
2017-08-01 14:30:58 +02:00
|
|
|
|
2019-01-03 14:26:51 +01:00
|
|
|
SHAPE_CONVEX_HULL = 3,
|
|
|
|
SHAPE_PLANE = 4,
|
|
|
|
SHAPE_CONCAVE_TRIMESH = 5,
|
|
|
|
SHAPE_COMPOUND_OF_CONVEX_HULLS = 6,
|
|
|
|
SHAPE_SPHERE = 7,
|
2017-08-01 14:30:58 +02:00
|
|
|
MAX_NUM_SHAPE_TYPES,
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct b3Collidable b3Collidable_t;
|
|
|
|
|
|
|
|
struct b3Collidable
|
|
|
|
{
|
|
|
|
union {
|
|
|
|
int m_numChildShapes;
|
|
|
|
int m_bvhIndex;
|
|
|
|
};
|
2019-01-03 14:26:51 +01:00
|
|
|
union {
|
2017-08-01 14:30:58 +02:00
|
|
|
float m_radius;
|
2019-01-03 14:26:51 +01:00
|
|
|
int m_compoundBvhIndex;
|
2017-08-01 14:30:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
int m_shapeType;
|
2019-01-03 14:26:51 +01:00
|
|
|
union {
|
2017-08-01 14:30:58 +02:00
|
|
|
int m_shapeIndex;
|
|
|
|
float m_height;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct b3GpuChildShape b3GpuChildShape_t;
|
|
|
|
struct b3GpuChildShape
|
|
|
|
{
|
2019-01-03 14:26:51 +01:00
|
|
|
b3Float4 m_childPosition;
|
|
|
|
b3Quat m_childOrientation;
|
|
|
|
union {
|
|
|
|
int m_shapeIndex; //used for SHAPE_COMPOUND_OF_CONVEX_HULLS
|
|
|
|
int m_capsuleAxis;
|
2017-08-01 14:30:58 +02:00
|
|
|
};
|
2019-01-03 14:26:51 +01:00
|
|
|
union {
|
|
|
|
float m_radius; //used for childshape of SHAPE_COMPOUND_OF_SPHERES or SHAPE_COMPOUND_OF_CAPSULES
|
|
|
|
int m_numChildShapes; //used for compound shape
|
2017-08-01 14:30:58 +02:00
|
|
|
};
|
2019-01-03 14:26:51 +01:00
|
|
|
union {
|
|
|
|
float m_height; //used for childshape of SHAPE_COMPOUND_OF_CAPSULES
|
|
|
|
int m_collidableShapeIndex;
|
2017-08-01 14:30:58 +02:00
|
|
|
};
|
2019-01-03 14:26:51 +01:00
|
|
|
int m_shapeType;
|
2017-08-01 14:30:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct b3CompoundOverlappingPair
|
|
|
|
{
|
|
|
|
int m_bodyIndexA;
|
|
|
|
int m_bodyIndexB;
|
2019-01-03 14:26:51 +01:00
|
|
|
// int m_pairType;
|
2017-08-01 14:30:58 +02:00
|
|
|
int m_childShapeIndexA;
|
|
|
|
int m_childShapeIndexB;
|
|
|
|
};
|
|
|
|
|
2019-01-03 14:26:51 +01:00
|
|
|
#endif //B3_COLLIDABLE_H
|