123456789101112131415161718192021222324252627282930313233 |
- #ifndef CORE_PLANE_HPP
- #define CORE_PLANE_HPP
- #include "math/Vector.hpp"
- #include "utils/ArrayString.hpp"
- 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;
- template<typename String>
- check_return Error toString(String& s) const {
- CORE_RETURN_ERROR(s.append("("));
- CORE_RETURN_ERROR(s.append(abc[0]));
- CORE_RETURN_ERROR(s.append(" x + "));
- CORE_RETURN_ERROR(s.append(abc[1]));
- CORE_RETURN_ERROR(s.append(" y + "));
- CORE_RETURN_ERROR(s.append(abc[2]));
- CORE_RETURN_ERROR(s.append(" z + "));
- CORE_RETURN_ERROR(s.append(d));
- CORE_RETURN_ERROR(s.append(')'));
- return Error::NONE;
- }
- };
- }
- #endif
|