summaryrefslogtreecommitdiffhomepage
path: root/src/quads.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-12-09 05:08:37 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-12-09 05:08:37 +0100
commit142a53e157d5f1f591feb2560b2e6260e4a2a249 (patch)
treea77cca5d23c2d7c9d4557ad7198ef92c71b200d6 /src/quads.cpp
parentb5592cb1813f2af3d2c7c56ae874e67c023644a9 (diff)
a
Diffstat (limited to 'src/quads.cpp')
-rw-r--r--src/quads.cpp30
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() },
}};
}