Plane.h 546 B

1234567891011121314151617181920212223242526
  1. #ifndef PLANE_H
  2. #define PLANE_H
  3. #include "math/Vector.h"
  4. #include "utils/StringBuffer.h"
  5. class Plane final {
  6. Vector3 abc;
  7. float d;
  8. public:
  9. Plane();
  10. Plane(const Vector3& a, const Vector3& b, const Vector3& c);
  11. float getSignedDistance(const Vector3& v) const;
  12. template<int L>
  13. void toString(StringBuffer<L>& s) const {
  14. s.append("(");
  15. s.append(abc[0]).append(" x + ");
  16. s.append(abc[1]).append(" y + ");
  17. s.append(abc[2]).append(" z + ");
  18. s.append(d).append(')');
  19. }
  20. };
  21. #endif