Storage for infinite plane.
More...
#include <plane.h>
|
| plane () |
| Default constructor.
|
|
| plane (const vec4 &p) |
| Constructor from a vec4.
|
|
| plane (float _a, float _b, float _c, float _d) |
| Constructor from individual float components.
|
|
auto | operator* (float s) const -> plane |
| Multiplies the plane by a scalar value.
|
|
auto | operator/ (float s) const -> plane |
| Divides the plane by a scalar value.
|
|
auto | operator*= (float s) -> plane & |
| Multiplies and assigns the plane by a scalar value.
|
|
auto | operator/= (float s) -> plane & |
| Divides and assigns the plane by a scalar value.
|
|
auto | operator+ () const -> plane |
| Unary plus operator.
|
|
auto | operator- () const -> plane |
| Unary minus operator.
|
|
auto | operator== (const plane &p) const -> bool |
| Equality operator.
|
|
auto | operator!= (const plane &p) const -> bool |
| Inequality operator.
|
|
auto | operator= (const vec4 &rhs) -> plane & |
| Assignment operator from vec4.
|
|
|
static auto | dot (const plane &p, const vec4 &v) -> float |
| Computes the dot product of the plane and a vec4.
|
|
static auto | dot_coord (const plane &p, const vec3 &v) -> float |
| Computes the dot product of the plane and a vec3 (considering the plane's distance).
|
|
static auto | dot_normal (const plane &p, const vec3 &v) -> float |
| Computes the dot product of the plane normal and a vec3.
|
|
static auto | from_point_normal (const vec3 &point, const vec3 &normal) -> plane |
| Creates a plane from a point and a normal.
|
|
static auto | from_points (const vec3 &v1, const vec3 &v2, const vec3 &v3) -> plane |
| Creates a plane from three points.
|
|
static auto | mul (const plane &p, const mat4 &m) -> plane |
| Transforms a plane by a 4x4 matrix.
|
|
static auto | normalize (const plane &p) -> plane |
| Normalizes the plane.
|
|
static auto | scale (const plane &p, float s) -> plane |
| Scales the plane by a scalar value.
|
|
|
vec4 | data = {0.0f, 0.0f, 0.0f, 0.0f} |
| The components of the plane.
|
|
Storage for infinite plane.
Definition at line 20 of file plane.h.
◆ plane() [1/3]
Default constructor.
Initializes the plane with all components set to zero.
◆ plane() [2/3]
math::plane::plane |
( |
const vec4 & | p | ) |
|
Constructor from a vec4.
Initializes the plane with the given vec4 components.
- Parameters
-
p | A vec4 representing the plane components. |
Definition at line 98 of file plane.cpp.
◆ plane() [3/3]
math::plane::plane |
( |
float | _a, |
|
|
float | _b, |
|
|
float | _c, |
|
|
float | _d ) |
Constructor from individual float components.
Initializes the plane with the given components.
- Parameters
-
_a | The x component of the plane normal. |
_b | The y component of the plane normal. |
_c | The z component of the plane normal. |
_d | The distance component of the plane. |
Definition at line 102 of file plane.cpp.
◆ dot()
auto math::plane::dot |
( |
const plane & | p, |
|
|
const vec4 & | v ) -> float |
|
static |
Computes the dot product of the plane and a vec4.
- Parameters
-
- Returns
- The dot product as a float.
Definition at line 5 of file plane.cpp.
◆ dot_coord()
auto math::plane::dot_coord |
( |
const plane & | p, |
|
|
const vec3 & | v ) -> float |
|
static |
Computes the dot product of the plane and a vec3 (considering the plane's distance).
- Parameters
-
- Returns
- The dot product as a float.
Definition at line 10 of file plane.cpp.
◆ dot_normal()
auto math::plane::dot_normal |
( |
const plane & | p, |
|
|
const vec3 & | v ) -> float |
|
static |
Computes the dot product of the plane normal and a vec3.
- Parameters
-
- Returns
- The dot product as a float.
Definition at line 15 of file plane.cpp.
◆ from_point_normal()
auto math::plane::from_point_normal |
( |
const vec3 & | point, |
|
|
const vec3 & | normal ) -> plane |
|
static |
Creates a plane from a point and a normal.
- Parameters
-
point | A point on the plane. |
normal | The normal vector of the plane. |
- Returns
- A new plane defined by the point and normal.
Definition at line 20 of file plane.cpp.
◆ from_points()
auto math::plane::from_points |
( |
const vec3 & | v1, |
|
|
const vec3 & | v2, |
|
|
const vec3 & | v3 ) -> plane |
|
static |
Creates a plane from three points.
- Parameters
-
v1 | The first point. |
v2 | The second point. |
v3 | The third point. |
- Returns
- A new plane defined by the three points.
Definition at line 26 of file plane.cpp.
◆ mul()
auto math::plane::mul |
( |
const plane & | p, |
|
|
const mat4 & | m ) -> plane |
|
static |
Transforms a plane by a 4x4 matrix.
- Parameters
-
p | The plane to be transformed. |
m | The transformation matrix. |
- Returns
- A new transformed plane.
Definition at line 32 of file plane.cpp.
◆ normalize()
auto math::plane::normalize |
( |
const plane & | p | ) |
-> plane |
|
static |
Normalizes the plane.
Normalizes the plane's normal vector and adjusts the distance component.
- Parameters
-
p | The plane to be normalized. |
- Returns
- A new normalized plane.
Definition at line 37 of file plane.cpp.
◆ operator!=()
auto math::plane::operator!= |
( |
const plane & | p | ) |
const -> bool |
Inequality operator.
Checks if two planes are not equal.
- Parameters
-
p | The plane to compare with. |
- Returns
- True if the planes are not equal, false otherwise.
Definition at line 85 of file plane.cpp.
◆ operator*()
auto math::plane::operator* |
( |
float | s | ) |
const -> plane |
Multiplies the plane by a scalar value.
- Parameters
-
s | The scalar value to multiply by. |
- Returns
- A new plane with each component multiplied by the scalar value.
Definition at line 48 of file plane.cpp.
◆ operator*=()
auto math::plane::operator*= |
( |
float | s | ) |
-> plane& |
Multiplies and assigns the plane by a scalar value.
- Parameters
-
s | The scalar value to multiply by. |
- Returns
- A reference to the plane after multiplication.
Definition at line 58 of file plane.cpp.
◆ operator+()
auto math::plane::operator+ |
( |
| ) |
const -> plane |
Unary plus operator.
- Returns
- A copy of the plane.
Definition at line 70 of file plane.cpp.
◆ operator-()
auto math::plane::operator- |
( |
| ) |
const -> plane |
Unary minus operator.
Negates all components of the plane.
- Returns
- A new plane with all components negated.
Definition at line 75 of file plane.cpp.
◆ operator/()
auto math::plane::operator/ |
( |
float | s | ) |
const -> plane |
Divides the plane by a scalar value.
- Parameters
-
s | The scalar value to divide by. |
- Returns
- A new plane with each component divided by the scalar value.
Definition at line 53 of file plane.cpp.
◆ operator/=()
auto math::plane::operator/= |
( |
float | s | ) |
-> plane& |
Divides and assigns the plane by a scalar value.
- Parameters
-
s | The scalar value to divide by. |
- Returns
- A reference to the plane after division.
Definition at line 64 of file plane.cpp.
◆ operator=()
auto math::plane::operator= |
( |
const vec4 & | rhs | ) |
-> plane& |
Assignment operator from vec4.
Assigns the components of the plane from a vec4.
- Parameters
-
rhs | The vec4 to assign from. |
- Returns
- A reference to the plane after assignment.
Definition at line 90 of file plane.cpp.
◆ operator==()
auto math::plane::operator== |
( |
const plane & | p | ) |
const -> bool |
Equality operator.
Checks if two planes are equal.
- Parameters
-
p | The plane to compare with. |
- Returns
- True if the planes are equal, false otherwise.
Definition at line 80 of file plane.cpp.
◆ scale()
auto math::plane::scale |
( |
const plane & | p, |
|
|
float | s ) -> plane |
|
static |
Scales the plane by a scalar value.
Multiplies each component of the plane by the given scalar value.
- Parameters
-
p | The plane to be scaled. |
s | The scalar value to multiply by. |
- Returns
- A new scaled plane.
Definition at line 43 of file plane.cpp.
◆ operator*
auto operator* |
( |
float | s, |
|
|
const plane & | p ) -> plane |
|
friend |
Scalar multiplication for a plane.
Multiplies each component of the plane by a scalar value.
- Parameters
-
s | Scalar value to multiply by. |
p | The plane to be multiplied. |
- Returns
- A new plane with each component multiplied by the scalar value.
Definition at line 255 of file plane.h.
◆ data
vec4 math::plane::data = {0.0f, 0.0f, 0.0f, 0.0f} |
The components of the plane.
The first three components represent the normal vector of the plane, and the fourth component represents the distance from the origin.
Definition at line 240 of file plane.h.
The documentation for this struct was generated from the following files:
- C:/Workspace/github/UnravelEngine/UnravelEngine/engine/core/math/plane.h
- C:/Workspace/github/UnravelEngine/UnravelEngine/engine/core/math/plane.cpp