2
0

debugdraw.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * Copyright 2011-2016 Branimir Karadzic. All rights reserved.
  3. * License: http://www.opensource.org/licenses/BSD-2-Clause
  4. */
  5. #ifndef DEBUGDRAW_H_HEADER_GUARD
  6. #define DEBUGDRAW_H_HEADER_GUARD
  7. #include <bx/allocator.h>
  8. #include "../bounds.h"
  9. struct Axis
  10. {
  11. enum Enum
  12. {
  13. X,
  14. Y,
  15. Z,
  16. Count
  17. };
  18. };
  19. ///
  20. void ddInit(bool _depthTestLess = true, bx::AllocatorI* _allocator = NULL);
  21. ///
  22. void ddShutdown();
  23. ///
  24. void ddBegin(uint8_t _viewId);
  25. ///
  26. void ddEnd();
  27. ///
  28. void ddPush();
  29. ///
  30. void ddPop();
  31. ///
  32. void ddSetState(bool _depthTest, bool _depthWrite, bool _clockwise);
  33. ///
  34. void ddSetColor(uint32_t _abgr);
  35. ///
  36. void ddSetLod(uint8_t _lod);
  37. ///
  38. void ddSetWireframe(bool _wireframe);
  39. ///
  40. void ddSetStipple(bool _stipple, float _scale = 1.0f, float _offset = 0.0f);
  41. ///
  42. void ddSetTransform(const void* _mtx);
  43. ///
  44. void ddSetTranslate(float _x, float _y, float _z);
  45. ///
  46. void ddMoveTo(float _x, float _y, float _z = 0.0f);
  47. ///
  48. void ddMoveTo(const void* _pos);
  49. ///
  50. void ddLineTo(float _x, float _y, float _z = 0.0f);
  51. ///
  52. void ddLineTo(const void* _pos);
  53. ///
  54. void ddClose();
  55. ///
  56. void ddDraw(const Aabb& _aabb);
  57. ///
  58. void ddDraw(const Cylinder& _cylinder, bool _capsule = false);
  59. ///
  60. void ddDraw(const Disk& _disk);
  61. ///
  62. void ddDraw(const Obb& _obb);
  63. ///
  64. void ddDraw(const Sphere& _sphere);
  65. ///
  66. void ddDrawFrustum(const void* _viewProj);
  67. ///
  68. void ddDrawArc(Axis::Enum _axis, float _x, float _y, float _z, float _radius, float _degrees);
  69. ///
  70. void ddDrawCircle(const void* _normal, const void* _center, float _radius, float _weight = 0.0f);
  71. ///
  72. void ddDrawCircle(Axis::Enum _axis, float _x, float _y, float _z, float _radius, float _weight = 0.0f);
  73. ///
  74. void ddDrawAxis(float _x, float _y, float _z, float _len = 1.0f, Axis::Enum _highlight = Axis::Count);
  75. ///
  76. void ddDrawGrid(const void* _normal, const void* _center, uint32_t _size = 20, float _step = 1.0f);
  77. ///
  78. void ddDrawGrid(Axis::Enum _axis, const void* _center, uint32_t _size = 20, float _step = 1.0f);
  79. ///
  80. void ddDrawOrb(float _x, float _y, float _z, float _radius, Axis::Enum _highlight = Axis::Count);
  81. #endif // DEBUGDRAW_H_HEADER_GUARD