btEmptyShape.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 "bullet/LinearMath/btVector3.h"
  17. #include "bullet/LinearMath/btTransform.h"
  18. #include "bullet/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. ATTRIBUTE_ALIGNED16(class) btEmptyShape : public btConcaveShape
  23. {
  24. public:
  25. BT_DECLARE_ALIGNED_ALLOCATOR();
  26. btEmptyShape();
  27. virtual ~btEmptyShape();
  28. ///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
  29. void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
  30. virtual void setLocalScaling(const btVector3& scaling)
  31. {
  32. m_localScaling = scaling;
  33. }
  34. virtual const btVector3& getLocalScaling() const
  35. {
  36. return m_localScaling;
  37. }
  38. virtual void calculateLocalInertia(btScalar mass,btVector3& inertia) const;
  39. virtual const char* getName()const
  40. {
  41. return "Empty";
  42. }
  43. virtual void processAllTriangles(btTriangleCallback* ,const btVector3& ,const btVector3& ) const
  44. {
  45. }
  46. protected:
  47. btVector3 m_localScaling;
  48. };
  49. #endif //BT_EMPTY_SHAPE_H