summaryrefslogtreecommitdiff
path: root/src/maths/primitives.h
diff options
context:
space:
mode:
authoromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-08-13 13:18:24 +1000
committeromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-08-13 13:18:24 +1000
commit0c2f902238010903388b7d9a3af00979340eff2c (patch)
treeb718d72d8761769ec4aefbfd74cbb2d695f89741 /src/maths/primitives.h
parent43d915b2ceb3f5e439c09c772e9ebc7542c1a2bb (diff)
add debug draw bbox and add topology to draw calls
Diffstat (limited to 'src/maths/primitives.h')
-rw-r--r--src/maths/primitives.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/maths/primitives.h b/src/maths/primitives.h
index 38ae1de..f7b390d 100644
--- a/src/maths/primitives.h
+++ b/src/maths/primitives.h
@@ -11,3 +11,18 @@ Geometry Geo_CreateCuboid(f32x3 extents);
Geometry Geo_CreateCylinder(f32 radius, f32 height, u32 resolution);
Geometry Geo_CreateUVsphere(f32 radius, u32 north_south_lines, u32 east_west_lines);
Geometry Geo_CreateIcosphere(f32 radius, f32 n_subdivisions);
+
+static const Vec3 BACK_BOT_LEFT = (Vec3){ 0, 0, 0 };
+static const Vec3 BACK_BOT_RIGHT = (Vec3){ 1, 0, 0 };
+static const Vec3 BACK_TOP_LEFT = (Vec3){ 0, 1, 0 };
+static const Vec3 BACK_TOP_RIGHT = (Vec3){ 1, 1, 0 };
+static const Vec3 FRONT_BOT_LEFT = (Vec3){ 0, 0, 1 };
+static const Vec3 FRONT_BOT_RIGHT = (Vec3){ 1, 0, 1 };
+static const Vec3 FRONT_TOP_LEFT = (Vec3){ 0, 1, 1 };
+static const Vec3 FRONT_TOP_RIGHT = (Vec3){ 1, 1, 1 };
+
+#define VERT_3D(arr, pos, norm, uv) \
+ { \
+ Vertex v = { .static_3d = { .position = pos, .normal = norm, .tex_coords = uv } }; \
+ Vertex_darray_push(arr, v); \
+ } \ No newline at end of file