You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.1 KiB

  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_EMPTY_SHAPE_H
  14. #define BT_EMPTY_SHAPE_H
  15. #include "btConcaveShape.h"
  16. #include "LinearMath/btVector3.h"
  17. #include "LinearMath/btTransform.h"
  18. #include "LinearMath/btMatrix3x3.h"
  19. #include "btCollisionMargin.h"
  20. /// The btEmptyShape is a collision shape without actual collision detection shape, so most users should ignore this class.
  21. /// It can be replaced by another shape during runtime, but the inertia tensor should be recomputed.
  22. class btEmptyShape : public btConcaveShape
  23. {
  24. public:
  25. btEmptyShape();
  26. virtual ~btEmptyShape();
  27. ///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
  28. void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
  29. virtual void setLocalScaling(const btVector3& scaling)
  30. {
  31. m_localScaling = scaling;
  32. }
  33. virtual const btVector3& getLocalScaling() const
  34. {
  35. return m_localScaling;
  36. }
  37. virtual void calculateLocalInertia(btScalar mass,btVector3& inertia) const;
  38. virtual const char* getName()const
  39. {
  40. return "Empty";
  41. }
  42. virtual void processAllTriangles(btTriangleCallback* ,const btVector3& ,const btVector3& ) const
  43. {
  44. }
  45. protected:
  46. btVector3 m_localScaling;
  47. };
  48. #endif //BT_EMPTY_SHAPE_H