#ifndef PLANE_H
#define PLANE_H

#include "math/Vector.h"
#include "utils/StringBuffer.h"

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<int L>
    void toString(StringBuffer<L>& s) const {
        s.append("(");
        s.append(abc[0]).append(" x + ");
        s.append(abc[1]).append(" y + ");
        s.append(abc[2]).append(" z + ");
        s.append(d).append(')');
    }
};

#endif