DebugDraw.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2013 GarageGames, LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. #ifndef _DEBUG_DRAW_H_
  23. #define _DEBUG_DRAW_H_
  24. #ifndef BOX2D_H
  25. #include "Box2D/Box2D.h"
  26. #endif
  27. #ifndef _MMATH_H_
  28. #include "math/mMath.h"
  29. #endif
  30. #ifndef _COLOR_H_
  31. #include "graphics/gColor.h"
  32. #endif
  33. //-----------------------------------------------------------------------------
  34. class DebugDraw
  35. {
  36. public:
  37. DebugDraw() {}
  38. virtual ~DebugDraw() {}
  39. void DrawAABB( const b2AABB& aabb, const ColorF& color );
  40. void DrawOOBB( const b2Vec2* pOOBB, const ColorF& color );
  41. void DrawAsleep( const b2Vec2* pOOBB, const ColorF& color );
  42. void DrawCollisionShapes( const b2Transform& xf, b2Body* pBody );
  43. void DrawSortPoint( const b2Vec2& worldPosition, const b2Vec2& size, const b2Vec2& localSortPoint );
  44. void DrawJoints( b2World* pWorld );
  45. void DrawShape( b2Fixture* fixture, const b2Transform& xf, const ColorF& color );
  46. void DrawPolygon( const b2Vec2* vertices, int32 vertexCount, const ColorF& color);
  47. void DrawSolidPolygon( const b2Vec2* vertices, int32 vertexCount, const ColorF& color);
  48. void DrawCircle( const b2Vec2& center, float32 radius, const ColorF& color);
  49. void DrawSolidCircle( const b2Vec2& center, float32 radius, const b2Vec2& axis, const ColorF& color);
  50. void DrawSegment( const b2Vec2& p1, const b2Vec2& p2, const ColorF& color);
  51. void DrawTransform(const b2Transform& xf);
  52. void DrawPoint(const b2Vec2& p, float32 size, const ColorF& color);
  53. };
  54. #endif // _DEBUG_DRAW_H_