math classes refactor

This commit is contained in:
h4570
2022-08-10 20:51:19 +02:00
parent 0df43e5a08
commit 10e0f52d44
8 changed files with 286 additions and 144 deletions
+4 -12
View File
@@ -14,27 +14,19 @@
#include "math/plane.hpp"
namespace Tyra {
Plane::Plane() { this->distance = 0; }
/** Create by specyfying 3 points.
* This function assumes that the points
* are given in counter clockwise order
*/
Plane::Plane(const Vec4& a, const Vec4& b, const Vec4& c) {
this->update(a, b, c);
}
Plane::~Plane() {}
// ----
// Methods
// ----
float Plane::distanceTo(const Vec4& t_vec) const {
return this->distance + this->normal.innerProduct(t_vec);
}
/**
* Set plane by specyfying 3 points.
* This function assumes that the points
* are given in counter clockwise order
*/
void Plane::update(const Vec4& a, const Vec4& b, const Vec4& c) {
Vec4 aux1 = a - b;
Vec4 aux2 = c - b;