MobileRT  1.0
A multi platform C++ CPU progressive Ray Tracer.
MobileRT::AABB Class Referencefinal

#include <AABB.hpp>

Collaboration diagram for MobileRT::AABB:
Collaboration graph

Public Member Functions

 AABB ()=default
 
 AABB (const ::glm::vec3 &pointMin, const ::glm::vec3 &pointMax)
 
 AABB (const AABB &aabb)=default
 
 AABB (AABB &&aabb) noexcept=default
 
 ~AABB ()=default
 
AABBoperator= (const AABB &aabb)=default
 
AABBoperator= (AABB &&aabb) noexcept=default
 
float getSurfaceArea () const
 
::glm::vec3 getCentroid () const
 
bool intersect (const Ray &ray) const
 
::glm::vec3 getPointMin () const
 
::glm::vec3 getPointMax () const
 

Private Member Functions

void checkArguments () const
 

Private Attributes

::glm::vec3 pointMin_ {}
 
::glm::vec3 pointMax_ {}
 

Detailed Description

A class which represents an Axis Aligned Bounding Box.
This type of bounding box consists of a box where all the edges are aligned with the axis of the scene.

Constructor & Destructor Documentation

◆ AABB() [1/4]

MobileRT::AABB::AABB ( )
explicitdefault

◆ AABB() [2/4]

AABB::AABB ( const ::glm::vec3 &  pointMin,
const ::glm::vec3 &  pointMax 
)
explicit

Constructor.

Parameters
pointMinThe point of the AABB in the bottom corner.
pointMaxThe point of the AABB in the upper corner.
Here is the call graph for this function:

◆ AABB() [3/4]

MobileRT::AABB::AABB ( const AABB aabb)
default

◆ AABB() [4/4]

MobileRT::AABB::AABB ( AABB &&  aabb)
defaultnoexcept

◆ ~AABB()

MobileRT::AABB::~AABB ( )
default

Member Function Documentation

◆ checkArguments()

void AABB::checkArguments ( ) const
private

Helper method which checks for invalid fields.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCentroid()

glm::vec3 AABB::getCentroid ( ) const

Calculates the centroid of this AABB.
The centroid or geometric center of a plane figure is the arithmetic mean position of all the points in the figure.

Returns
The centroid.
Here is the caller graph for this function:

◆ getPointMax()

glm::vec3 AABB::getPointMax ( ) const

Gets the point max of this AABB.

Returns
The point max.
Here is the caller graph for this function:

◆ getPointMin()

glm::vec3 AABB::getPointMin ( ) const

Gets the point min of this AABB.

Returns
The point min.
Here is the caller graph for this function:

◆ getSurfaceArea()

float AABB::getSurfaceArea ( ) const

Calculates the surface area of this AABB.

Returns
The surface area.

◆ intersect()

bool AABB::intersect ( const Ray ray) const

Checks if a ray intersects this AABB.

Parameters
rayA casted ray.
Returns
Whether the ray intersected this AABB.
Here is the caller graph for this function:

◆ operator=() [1/2]

AABB& MobileRT::AABB::operator= ( const AABB aabb)
default

◆ operator=() [2/2]

AABB& MobileRT::AABB::operator= ( AABB &&  aabb)
defaultnoexcept

Member Data Documentation

◆ pointMax_

::glm::vec3 MobileRT::AABB::pointMax_ {}
private

◆ pointMin_

::glm::vec3 MobileRT::AABB::pointMin_ {}
private

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