1
0

btConcaveShape.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. Bullet Continuous Collision Detection and Physics Library
  3. Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org
  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_CONCAVE_SHAPE_H
  14. #define BT_CONCAVE_SHAPE_H
  15. #include "btCollisionShape.h"
  16. #include "bullet/BulletCollision//BroadphaseCollision/btBroadphaseProxy.h" // for the types
  17. #include "btTriangleCallback.h"
  18. /// PHY_ScalarType enumerates possible scalar types.
  19. /// See the btStridingMeshInterface or btHeightfieldTerrainShape for its use
  20. typedef enum PHY_ScalarType {
  21. PHY_FLOAT,
  22. PHY_DOUBLE,
  23. PHY_INTEGER,
  24. PHY_SHORT,
  25. PHY_FIXEDPOINT88,
  26. PHY_UCHAR
  27. } PHY_ScalarType;
  28. ///The btConcaveShape class provides an interface for non-moving (static) concave shapes.
  29. ///It has been implemented by the btStaticPlaneShape, btBvhTriangleMeshShape and btHeightfieldTerrainShape.
  30. ATTRIBUTE_ALIGNED16(class) btConcaveShape : public btCollisionShape
  31. {
  32. protected:
  33. btScalar m_collisionMargin;
  34. public:
  35. BT_DECLARE_ALIGNED_ALLOCATOR();
  36. btConcaveShape();
  37. virtual ~btConcaveShape();
  38. virtual void processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const = 0;
  39. virtual btScalar getMargin() const {
  40. return m_collisionMargin;
  41. }
  42. virtual void setMargin(btScalar collisionMargin)
  43. {
  44. m_collisionMargin = collisionMargin;
  45. }
  46. };
  47. #endif //BT_CONCAVE_SHAPE_H