diff --git a/include/omath/3d_primitives/box.hpp b/include/omath/3d_primitives/box.hpp index 3b786e3..d915ca2 100644 --- a/include/omath/3d_primitives/box.hpp +++ b/include/omath/3d_primitives/box.hpp @@ -4,12 +4,14 @@ #pragma once #include +#include "omath/triangle.hpp" #include "omath/vector3.hpp" + namespace omath::primitives { [[nodiscard]] - std::array, 8> CreateBox(const Vector3& top, const Vector3& bottom, - const Vector3& dirForward, const Vector3& dirRight, - float ratio = 4.f); + std::array>, 8> CreateBox(const Vector3& top, const Vector3& bottom, + const Vector3& dirForward, const Vector3& dirRight, + float ratio = 4.f); } diff --git a/source/3d_primitives/box.cpp b/source/3d_primitives/box.cpp index 4403b23..202e47b 100644 --- a/source/3d_primitives/box.cpp +++ b/source/3d_primitives/box.cpp @@ -3,10 +3,12 @@ // #include "omath/3d_primitives/box.hpp" + + namespace omath::primitives { - std::array, 8> CreateBox(const Vector3& top, const Vector3& bottom, + std::array>, 8> CreateBox(const Vector3& top, const Vector3& bottom, const Vector3& dirForward, const Vector3& dirRight, const float ratio) @@ -28,6 +30,10 @@ namespace omath::primitives points[6] = top + (-dirForward + dirRight) * sideSize; points[7] = top + (-dirForward - dirRight) * sideSize; - return points; + + std::array>, 8> polygons; + + polygons[0] = {points[0], points[2], points[3]}; + return polygons; } }