diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-12-09 05:08:37 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-12-09 05:08:37 +0100 |
commit | 142a53e157d5f1f591feb2560b2e6260e4a2a249 (patch) | |
tree | a77cca5d23c2d7c9d4557ad7198ef92c71b200d6 /src/quads.cpp | |
parent | b5592cb1813f2af3d2c7c56ae874e67c023644a9 (diff) |
a
Diffstat (limited to 'src/quads.cpp')
-rw-r--r-- | src/quads.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/quads.cpp b/src/quads.cpp index a02654b0..801c0448 100644 --- a/src/quads.cpp +++ b/src/quads.cpp @@ -13,34 +13,34 @@ std::array<UnsignedShort, 6> quad_indexes(size_t N) quad floor_quad(const Vector3 center, const Vector2 size) { - float x = size[0]*.5f, y = size[1]*.5f; + float x = size.x()*.5f, y = size.y()*.5f; return {{ - { x + center[0], -y + center[1], center[2]}, - { x + center[0], y + center[1], center[2]}, - {-x + center[0], -y + center[1], center[2]}, - {-x + center[0], y + center[1], center[2]}, + { x + center.x(), -y + center.y(), center.z()}, + { x + center.x(), y + center.y(), center.z()}, + {-x + center.x(), -y + center.y(), center.z()}, + {-x + center.x(), y + center.y(), center.z()}, }}; } quad wall_quad_W(const Vector3 center, const Vector3 size) { - float x = size[0]*.5f, y = size[1]*.5f, z = size[2]; + float x = size.x()*.5f, y = size.y()*.5f, z = size.z(); return {{ - {-x + center[0], y + center[1], z + center[2] }, - {-x + center[0], y + center[1], center[2] }, - {-x + center[0], -y + center[1], z + center[2] }, - {-x + center[0], -y + center[1], center[2] }, + {-x + center.x(), -y + center.y(), z + center.z() }, + {-x + center.x(), -y + center.y(), center.z() }, + {-x + center.x(), y + center.y(), z + center.z() }, + {-x + center.x(), y + center.y(), center.z() }, }}; } quad wall_quad_N(const Vector3 center, const Vector3 size) { - float x = size[0]*.5f, y = size[1]*.5f, z = size[2]; + float x = size.x()*.5f, y = size.y()*.5f, z = size.z(); return {{ - { x + center[0], -y + center[1], z + center[2] }, - { x + center[0], -y + center[1], center[2] }, - {-x + center[0], -y + center[1], z + center[2] }, - {-x + center[0], -y + center[1], center[2] }, + { x + center.x(), -y + center.y(), z + center.z() }, + { x + center.x(), -y + center.y(), center.z() }, + {-x + center.x(), -y + center.y(), z + center.z() }, + {-x + center.x(), -y + center.y(), center.z() }, }}; } |