Kinoko
A reimplementation of Mario Kart Wii's physics engine in C++
Toggle main menu visibility
Loading...
Searching...
No Matches
Plane.hh
1
#pragma once
2
3
#include "egg/math/Vector.hh"
4
5
namespace
Kinoko::EGG
{
6
10
struct
Plane3f {
12
constexpr
Plane3f() =
default
;
13
15
constexpr
Plane3f(
const
Vector3f
&point,
const
Vector3f
&normal) {
16
set(point, normal);
17
}
18
20
constexpr
~Plane3f() =
default
;
21
23
constexpr
void
set(
const
Vector3f
&point,
const
Vector3f
&normal) {
24
n
= normal;
25
d
= -(normal.
dot
(point));
26
}
27
29
[[nodiscard]]
constexpr
bool
testPoint(
const
Vector3f
&point)
const
{
30
return
d
+
n
.dot(point) <= 0.0f;
31
}
32
33
Vector3f
n
;
34
f32
d
;
35
};
36
37
}
// namespace Kinoko::EGG
Kinoko::EGG
EGG core library.
Definition
Allocator.hh:5
Kinoko::EGG::Plane3f::d
f32 d
Negated dot product. n.dot(x) = d => n.dot(x) - d = 0.
Definition
Plane.hh:34
Kinoko::EGG::Plane3f::n
Vector3f n
Plane normal.
Definition
Plane.hh:33
Kinoko::EGG::Vector3f
A 3D float vector.
Definition
Vector.hh:107
Kinoko::EGG::Vector3f::dot
constexpr f32 dot(const Vector3f &rhs) const
The dot product between two vectors.
Definition
Vector.hh:206
egg
geom
Plane.hh
Made by
Malleo
. Logo by
vabold
. Website generated by
Doxygen
1.17.0