MobileRT
1.0
A multi platform C++ CPU progressive Ray Tracer.
|
#include <Plane.hpp>
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 | |
Plane & | operator= (const Plane &plane)=default |
Plane & | operator= (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} |
A class which represents a plane in the scene.
|
explicitdelete |
|
explicit |
|
default |
|
defaultnoexcept |
|
default |
|
private |
Helper method which checks for invalid fields.
float Plane::distance | ( | const ::glm::vec3 & | point | ) | const |
Calculates the distance between a point and the plane.
point | A 3D point in the scene. |
AABB Plane::getAABB | ( | ) | const |
Calculates the bounding box of the plane.
std::int32_t Plane::getMaterialIndex | ( | ) | const |
Gets the material index of this plane.
glm::vec3 Plane::getNormal | ( | ) | const |
Gets the normal of this plane.
glm::vec3 Plane::getPoint | ( | ) | const |
Gets the point of this plane.
|
private |
The helper method which calculates the right vector.
Intersection Plane::intersect | ( | Intersection | intersection | ) | const |
Determines if a ray intersects this plane or not and calculates the intersection point.
intersection | The previous intersection of the ray in the scene. |
bool Plane::intersect | ( | const AABB & | box | ) | const |
Checks if a bounding box intersects the plane or not.
box | A bounding box. |
|
private |
|
private |
|
private |