Plane.cpp 296 B

123456789101112
  1. #include "math/Plane.hpp"
  2. Core::Plane::Plane() : abc(), d(0) {
  3. }
  4. Core::Plane::Plane(const Vector3& a, const Vector3& b, const Vector3& c)
  5. : abc((b - a).cross(c - a).normalize()), d(-abc.dot(b)) {
  6. }
  7. float Core::Plane::getSignedDistance(const Vector3& v) const {
  8. return abc.dot(v) + d;
  9. }