mal-math
C++20 mathematics library.
All Classes Namespaces Files Functions Variables Typedefs Concepts
mal_math::Plane Struct Reference

Represents a plane in 3D space defined by its normal and two vectors. More...

#include "plane.hpp"

Collaboration diagram for mal_math::Plane:
[legend]

Public Member Functions

bool Intersect (Intersection &i, Ray const &ray) const
 Checks for the intersection of the plane with a given ray.
 
void update_plane (vec3 const &first, vec3 const &second)
 Updates the plane's vectors and normal based on two new vectors.
 

Public Attributes

vec3 v
 One of the vectors defining the plane.
 
vec3 w
 The other vector defining the plane.
 
vec3 normal
 The normal to the plane.
 

Detailed Description

Represents a plane in 3D space defined by its normal and two vectors.

This structure provides functionalities such as checking for intersections with rays and updating the plane based on new vector inputs.

Definition at line 28 of file plane.hpp.

Member Function Documentation

◆ Intersect()

bool mal_math::Plane::Intersect ( Intersection & i,
Ray const & ray ) const
inline

Checks for the intersection of the plane with a given ray.

Parameters
iIntersection data to update if an intersection occurs.
rayThe ray to check for intersection with the plane.
Returns
True if the ray intersects the plane, false otherwise.

Definition at line 37 of file plane.hpp.

Here is the call graph for this function:

◆ update_plane()

void mal_math::Plane::update_plane ( vec3 const & first,
vec3 const & second )
inline

Updates the plane's vectors and normal based on two new vectors.

Parameters
firstThe first vector to define the plane.
secondThe second vector to define the plane.
Exceptions
std::invalid_argumentif the provided vectors are collinear.

Definition at line 62 of file plane.hpp.

Here is the call graph for this function:

Member Data Documentation

◆ normal

vec3 mal_math::Plane::normal

The normal to the plane.

Definition at line 75 of file plane.hpp.

◆ v

vec3 mal_math::Plane::v

One of the vectors defining the plane.

Definition at line 73 of file plane.hpp.

◆ w

vec3 mal_math::Plane::w

The other vector defining the plane.

Definition at line 74 of file plane.hpp.


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