5#include <glm/gtc/matrix_transform.hpp>
67 plane(
float _a,
float _b,
float _c,
float _d);
80 static auto dot(
const plane& p,
const vec4& v) -> float;
117 static auto from_points(
const vec3& v1,
const vec3& v2,
const vec3& v3) ->
plane;
198 auto operator-() const ->
plane;
208 auto operator==(const
plane& p) const ->
bool;
218 auto operator!=(const
plane& p) const ->
bool;
228 auto operator=(const vec4& rhs) ->
plane&;
240 vec4
data = {0.0f, 0.0f, 0.0f, 0.0f};
257 return plane(p.data * s);
auto operator*(float s, const plane &p) -> plane
Scalar multiplication for a plane.
Storage for infinite plane.
auto operator*=(float s) -> plane &
Multiplies and assigns the plane by a scalar value.
static auto normalize(const plane &p) -> plane
Normalizes the plane.
static auto from_point_normal(const vec3 &point, const vec3 &normal) -> plane
Creates a plane from a point and a normal.
auto operator+() const -> plane
Unary plus operator.
friend auto operator*(float s, const plane &p) -> plane
Scalar multiplication for a plane.
auto operator/(float s) const -> plane
Divides the plane by a scalar value.
static auto from_points(const vec3 &v1, const vec3 &v2, const vec3 &v3) -> plane
Creates a plane from three points.
static auto dot_normal(const plane &p, const vec3 &v) -> float
Computes the dot product of the plane normal and a vec3.
auto operator/=(float s) -> plane &
Divides and assigns the plane by a scalar value.
plane()
Default constructor.
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 mul(const plane &p, const mat4 &m) -> plane
Transforms a plane by a 4x4 matrix.
vec4 data
The components of the plane.