Changeset View
Changeset View
Standalone View
Standalone View
extern/bullet2/src/BulletCollision/CollisionShapes/btShapeHull.h
| Show All 15 Lines | |||||
| ///btShapeHull implemented by John McCutchan. | ///btShapeHull implemented by John McCutchan. | ||||
| #ifndef BT_SHAPE_HULL_H | #ifndef BT_SHAPE_HULL_H | ||||
| #define BT_SHAPE_HULL_H | #define BT_SHAPE_HULL_H | ||||
| #include "LinearMath/btAlignedObjectArray.h" | #include "LinearMath/btAlignedObjectArray.h" | ||||
| #include "BulletCollision/CollisionShapes/btConvexShape.h" | #include "BulletCollision/CollisionShapes/btConvexShape.h" | ||||
| ///The btShapeHull class takes a btConvexShape, builds a simplified convex hull using btConvexHull and provides triangle indices and vertices. | ///The btShapeHull class takes a btConvexShape, builds a simplified convex hull using btConvexHull and provides triangle indices and vertices. | ||||
| ///It can be useful for to simplify a complex convex object and for visualization of a non-polyhedral convex object. | ///It can be useful for to simplify a complex convex object and for visualization of a non-polyhedral convex object. | ||||
| ///It approximates the convex hull using the supporting vertex of 42 directions. | ///It approximates the convex hull using the supporting vertex of 42 directions. | ||||
| ATTRIBUTE_ALIGNED16(class) btShapeHull | ATTRIBUTE_ALIGNED16(class) | ||||
| btShapeHull | |||||
| { | { | ||||
| protected: | protected: | ||||
| btAlignedObjectArray<btVector3> m_vertices; | btAlignedObjectArray<btVector3> m_vertices; | ||||
| btAlignedObjectArray<unsigned int> m_indices; | btAlignedObjectArray<unsigned int> m_indices; | ||||
| unsigned int m_numIndices; | unsigned int m_numIndices; | ||||
| const btConvexShape* m_shape; | const btConvexShape* m_shape; | ||||
| static btVector3* getUnitSpherePoints(); | static btVector3* getUnitSpherePoints(int highres = 0); | ||||
| public: | public: | ||||
| BT_DECLARE_ALIGNED_ALLOCATOR(); | BT_DECLARE_ALIGNED_ALLOCATOR(); | ||||
| btShapeHull (const btConvexShape* shape); | btShapeHull(const btConvexShape* shape); | ||||
| ~btShapeHull (); | ~btShapeHull(); | ||||
| bool buildHull (btScalar margin); | bool buildHull(btScalar margin, int highres = 0); | ||||
| int numTriangles () const; | int numTriangles() const; | ||||
| int numVertices () const; | int numVertices() const; | ||||
| int numIndices () const; | int numIndices() const; | ||||
| const btVector3* getVertexPointer() const | const btVector3* getVertexPointer() const | ||||
| { | { | ||||
| return &m_vertices[0]; | return &m_vertices[0]; | ||||
| } | } | ||||
| const unsigned int* getIndexPointer() const | const unsigned int* getIndexPointer() const | ||||
| { | { | ||||
| return &m_indices[0]; | return &m_indices[0]; | ||||
| } | } | ||||
| }; | }; | ||||
| #endif //BT_SHAPE_HULL_H | #endif //BT_SHAPE_HULL_H | ||||