Render simple shapes for debugging purposes.
More...
#include <OxygenEngine/render/debug.h>
|
void | render (oe::scene::Camera &camera, const bool flush=true) |
| Render all debug objects and clean buffer.
|
|
void | flush () |
| Flush buffer without rendering.
|
|
|
static void | axis (const float &length=1.0f, const float &arrow_size=0.1f) |
| Draw origin axis.
|
|
static void | transform (const glm::mat4 &model, const float &length=1.0f, const float &arrow_size=0.1f) |
| Draw a transform.
|
|
static void | tbn (const glm::vec3 &origin, const glm::vec3 &tangent, const glm::vec3 &bitangent, const glm::vec3 &normal, const float &length=1.0) |
| Render vertex TBN (Tangent, bi-tangent, normal)
|
|
static void | aabb (const oe::scene::AABB &bbox, const glm::vec3 &color=glm::vec3(1.0)) |
| Draw a bounding box.
|
|
static void | point (const glm::vec3 &position, const float &size=10.0f, const glm::vec3 &color=glm::vec3(1.0)) |
| Draw a point.
|
|
static void | sphere (const glm::vec3 ¢er, const float &radius, const glm::vec3 &color=glm::vec3(1.0)) |
| Draw a sphere.
|
|
static void | box (const glm::vec3 &min, const glm::vec3 &max, const glm::vec3 &color=glm::vec3(1.0)) |
| Draw a box between two corners.
|
|
static void | line (const glm::vec3 &start, const glm::vec3 &end, const glm::vec3 &color=glm::vec3(1.0)) |
| Draw a line between two points.
|
|
static void | arrow (const glm::vec3 &start, const glm::vec3 &end, const float &size=1.0f, const glm::vec3 &color=glm::vec3(1.0)) |
|
static void | cone (const glm::vec3 &start, const glm::vec3 &end, const float &baseAngle=1.0f, const float &apexAngle=0.0f, const glm::vec3 &color=glm::vec3(1.0)) |
|
static void | frustum (const oe::scene::Camera &camera, const glm::vec3 &color=glm::vec3(1.0)) |
| Draw the frustum pyramid of a camera.
|
|
static Debug * | getInstance () |
|
Render simple shapes for debugging purposes.
- Note
- Methods are static to easy debug like oe::scene::Debug::aabb
◆ aabb()
static void oe::render::Debug::aabb |
( |
const oe::scene::AABB & |
bbox, |
|
|
const glm::vec3 & |
color = glm::vec3(1.0) |
|
) |
| |
|
static |
Draw a bounding box.
- Parameters
-
bbox | Bounding box |
color | Box color |
◆ axis()
static void oe::render::Debug::axis |
( |
const float & |
length = 1.0f , |
|
|
const float & |
arrow_size = 0.1f |
|
) |
| |
|
static |
Draw origin axis.
- Parameters
-
length | line length |
arrow_size | arrow thickness |
◆ box()
static void oe::render::Debug::box |
( |
const glm::vec3 & |
min, |
|
|
const glm::vec3 & |
max, |
|
|
const glm::vec3 & |
color = glm::vec3(1.0) |
|
) |
| |
|
static |
Draw a box between two corners.
- Parameters
-
min | Box bottom corner |
max | Box top corner |
color | Sphere color |
◆ frustum()
static void oe::render::Debug::frustum |
( |
const oe::scene::Camera & |
camera, |
|
|
const glm::vec3 & |
color = glm::vec3(1.0) |
|
) |
| |
|
static |
Draw the frustum pyramid of a camera.
- Parameters
-
camera | The camera to use as frustum source |
color | frustum color |
◆ line()
static void oe::render::Debug::line |
( |
const glm::vec3 & |
start, |
|
|
const glm::vec3 & |
end, |
|
|
const glm::vec3 & |
color = glm::vec3(1.0) |
|
) |
| |
|
static |
Draw a line between two points.
- Parameters
-
start | first point |
end | second point |
color | line color |
◆ point()
static void oe::render::Debug::point |
( |
const glm::vec3 & |
position, |
|
|
const float & |
size = 10.0f , |
|
|
const glm::vec3 & |
color = glm::vec3(1.0) |
|
) |
| |
|
static |
Draw a point.
- Parameters
-
position | Point position |
size | Point size in pixels |
color | Point color |
◆ render()
void oe::render::Debug::render |
( |
oe::scene::Camera & |
camera, |
|
|
const bool |
flush = true |
|
) |
| |
Render all debug objects and clean buffer.
- Parameters
-
flush | Clean buffer after render (set to false if you need to render debug objects multiple times without cleaning, eg. in VR or in a multipass pipeline) |
◆ sphere()
static void oe::render::Debug::sphere |
( |
const glm::vec3 & |
center, |
|
|
const float & |
radius, |
|
|
const glm::vec3 & |
color = glm::vec3(1.0) |
|
) |
| |
|
static |
Draw a sphere.
- Parameters
-
center | Sphere position |
radius | Sphere radius |
color | Sphere color |
◆ tbn()
static void oe::render::Debug::tbn |
( |
const glm::vec3 & |
origin, |
|
|
const glm::vec3 & |
tangent, |
|
|
const glm::vec3 & |
bitangent, |
|
|
const glm::vec3 & |
normal, |
|
|
const float & |
length = 1.0 |
|
) |
| |
|
static |
Render vertex TBN (Tangent, bi-tangent, normal)
- Note
- Colors meaning are: normal=WHITE, tangent=YELLOW, bi-tangent=MAGENTA.
◆ transform()
static void oe::render::Debug::transform |
( |
const glm::mat4 & |
model, |
|
|
const float & |
length = 1.0f , |
|
|
const float & |
arrow_size = 0.1f |
|
) |
| |
|
static |
Draw a transform.
- Parameters
-
model | Transform model matrix |
length | line length |
arrow_size | arrow thickness |
The documentation for this class was generated from the following file:
- OxygenEngine/render/debug.h