123456789101112131415161718192021222324252627 |
- #ifndef CORE_PLANE_H
- #define CORE_PLANE_H
- #include "math/Vector.h"
- #include "utils/ArrayString.h"
- namespace Core {
- class Plane final {
- Vector3 abc;
- float d;
- public:
- Plane();
- Plane(const Vector3& a, const Vector3& b, const Vector3& c);
- float getSignedDistance(const Vector3& v) const;
- // returns true on error and calls the error callback
- template<int L>
- check_return bool toString(ArrayString<L>& s) const {
- return s.append("(") || s.append(abc[0]) || s.append(" x + ") ||
- s.append(abc[1]) || s.append(" y + ") || s.append(abc[2]) ||
- s.append(" z + ") || s.append(d) || s.append(')');
- }
- };
- }
- #endif
|