This commit is contained in:
2026-01-26 18:59:34 +03:00
parent d6746f6243
commit 68505a77ae
2 changed files with 6 additions and 4 deletions

View File

@@ -13,7 +13,7 @@
namespace omath::primitives namespace omath::primitives
{ {
using BoxMesh = Mesh<opengl_engine::Mat4X4, opengl_engine::ViewAngles, opengl_engine::MeshTrait, Vertex<>, using BoxMesh = Mesh<opengl_engine::Mat4X4, opengl_engine::ViewAngles, opengl_engine::MeshTrait, Vertex<>,
std::array<Vertex<>, 8>, std::array<Vector3<std::uint32_t>, 12>>; std::array<Vector3<float>, 8>, std::array<Vector3<std::uint32_t>, 12>>;
template<class BoxMeshType = BoxMesh> template<class BoxMeshType = BoxMesh>
[[nodiscard]] [[nodiscard]]

View File

@@ -14,7 +14,8 @@
namespace omath::primitives namespace omath::primitives
{ {
using PlaneMesh = Mesh<opengl_engine::Mat4X4, opengl_engine::ViewAngles, opengl_engine::MeshTrait, Vertex<>, using PlaneMesh = Mesh<opengl_engine::Mat4X4, opengl_engine::ViewAngles, opengl_engine::MeshTrait, Vertex<>,
std::array<Vector3<float>, 4>, std::array<Vector3<std::uint32_t>, 6>>; std::array<Vector3<float>, 4>, std::array<Vector3<std::uint32_t>, 2>>;
template<class PlaneMeshType>
[[nodiscard]] [[nodiscard]]
PlaneMesh create_plane(const Vector3<float>& vertex_a, const Vector3<float>& vertex_b, PlaneMesh create_plane(const Vector3<float>& vertex_a, const Vector3<float>& vertex_b,
const Vector3<float>& direction, const float size) noexcept const Vector3<float>& direction, const float size) noexcept
@@ -24,8 +25,9 @@ namespace omath::primitives
std::array<Vector3<float>, 4> grid = {vertex_a, vertex_b, second_vertex_a, second_vertex_b}; std::array<Vector3<float>, 4> grid = {vertex_a, vertex_b, second_vertex_a, second_vertex_b};
std::array<Vector3<std::uint32_t>, 6> poly; std::array<Vector3<std::uint32_t>, 2> poly;
poly[0] = {}; poly[0] = {1, 1, 2};
poly[1] = {0, 1, 3};
return PlaneMesh(std::move(grid), std::move(poly)); return PlaneMesh(std::move(grid), std::move(poly));
} }