Oxygen Engine
Modern C++ 3D Engine using OpenGL
Loading...
Searching...
No Matches
oe::render::Debug Class Reference

Render simple shapes for debugging purposes. More...

#include <OxygenEngine/render/debug.h>

Public Member Functions

void render (oe::scene::Camera &camera, const bool flush=true)
 Render all debug objects and clean buffer.
 
void flush ()
 Flush buffer without rendering.
 

Static Public Member Functions

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 &center, 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 DebuggetInstance ()
 

Friends

class core::Device
 

Detailed Description

Render simple shapes for debugging purposes.

Note
Methods are static to easy debug like oe::scene::Debug::aabb

Member Function Documentation

◆ 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
bboxBounding box
colorBox color

◆ axis()

static void oe::render::Debug::axis ( const float &  length = 1.0f,
const float &  arrow_size = 0.1f 
)
static

Draw origin axis.

Parameters
lengthline length
arrow_sizearrow 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
minBox bottom corner
maxBox top corner
colorSphere 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
cameraThe camera to use as frustum source
colorfrustum 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
startfirst point
endsecond point
colorline 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
positionPoint position
sizePoint size in pixels
colorPoint color

◆ render()

void oe::render::Debug::render ( oe::scene::Camera camera,
const bool  flush = true 
)

Render all debug objects and clean buffer.

Parameters
flushClean 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
centerSphere position
radiusSphere radius
colorSphere 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
modelTransform model matrix
lengthline length
arrow_sizearrow thickness

The documentation for this class was generated from the following file: