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

#include <Plane.hpp>

Collaboration diagram for MobileRT::Plane:
Collaboration graph

Public Member Functions

 Plane ()=delete
 
 Plane (const ::glm::vec3 &point, const ::glm::vec3 &normal, ::std::int32_t materialIndex)
 
 Plane (const Plane &plane)=default
 
 Plane (Plane &&plane) noexcept=default
 
 ~Plane ()=default
 
Planeoperator= (const Plane &plane)=default
 
Planeoperator= (Plane &&plane) noexcept=default
 
Intersection intersect (Intersection intersection) const
 
AABB getAABB () const
 
float distance (const ::glm::vec3 &point) const
 
bool intersect (const AABB &box) const
 
::glm::vec3 getNormal () const
 
::glm::vec3 getPoint () const
 
::std::int32_t getMaterialIndex () const
 

Private Member Functions

::glm::vec3 getRightVector () const
 
void checkArguments () const
 

Private Attributes

::glm::vec3 normal_ {}
 
::glm::vec3 point_ {}
 
::std::int32_t materialIndex_ {-1}
 

Detailed Description

A class which represents a plane in the scene.

Constructor & Destructor Documentation

◆ Plane() [1/4]

MobileRT::Plane::Plane ( )
explicitdelete

◆ Plane() [2/4]

MobileRT::Plane::Plane ( const ::glm::vec3 &  point,
const ::glm::vec3 &  normal,
::std::int32_t  materialIndex 
)
explicit

◆ Plane() [3/4]

MobileRT::Plane::Plane ( const Plane plane)
default

◆ Plane() [4/4]

MobileRT::Plane::Plane ( Plane &&  plane)
defaultnoexcept

◆ ~Plane()

MobileRT::Plane::~Plane ( )
default

Member Function Documentation

◆ checkArguments()

void Plane::checkArguments ( ) const
private

Helper method which checks for invalid fields.

Here is the call graph for this function:

◆ distance()

float Plane::distance ( const ::glm::vec3 &  point) const

Calculates the distance between a point and the plane.

Parameters
pointA 3D point in the scene.
Returns
The distance between the point and the plane.

◆ getAABB()

AABB Plane::getAABB ( ) const

Calculates the bounding box of the plane.

Returns
The bounding box of the plane.

◆ getMaterialIndex()

std::int32_t Plane::getMaterialIndex ( ) const

Gets the material index of this plane.

Returns
The material index.

◆ getNormal()

glm::vec3 Plane::getNormal ( ) const

Gets the normal of this plane.

Returns
The normal.

◆ getPoint()

glm::vec3 Plane::getPoint ( ) const

Gets the point of this plane.

Returns
The point.

◆ getRightVector()

glm::vec3 Plane::getRightVector ( ) const
private

The helper method which calculates the right vector.

Returns
The right vector.
Here is the call graph for this function:

◆ intersect() [1/2]

Intersection Plane::intersect ( Intersection  intersection) const

Determines if a ray intersects this plane or not and calculates the intersection point.

Parameters
intersectionThe previous intersection of the ray in the scene.
Returns
The intersection point.

◆ intersect() [2/2]

bool Plane::intersect ( const AABB box) const

Checks if a bounding box intersects the plane or not.

Parameters
boxA bounding box.
Returns
Whether if the bounding box intersects the plane or not.
Here is the call graph for this function:

◆ operator=() [1/2]

Plane& MobileRT::Plane::operator= ( const Plane plane)
default

◆ operator=() [2/2]

Plane& MobileRT::Plane::operator= ( Plane &&  plane)
defaultnoexcept

Member Data Documentation

◆ materialIndex_

::std::int32_t MobileRT::Plane::materialIndex_ {-1}
private

◆ normal_

::glm::vec3 MobileRT::Plane::normal_ {}
private

◆ point_

::glm::vec3 MobileRT::Plane::point_ {}
private

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