From dfb6adbcbcc7d50b770b6d5ea82efdd8f8c32e25 Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Sat, 5 Oct 2024 12:48:05 +1000 Subject: delete documentation workflow --- archive/src/maths/primitives.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 archive/src/maths/primitives.h (limited to 'archive/src/maths/primitives.h') diff --git a/archive/src/maths/primitives.h b/archive/src/maths/primitives.h new file mode 100644 index 0000000..4965545 --- /dev/null +++ b/archive/src/maths/primitives.h @@ -0,0 +1,29 @@ +#pragma once + +#include +#include +#include "core.h" +#include "maths_types.h" +#include "render_types.h" + +Geometry Geo_CreatePlane(f32x2 extents, u32 tiling_u, u32 tiling_v); +Geometry Geo_CreateCuboid(f32x3 extents); +Geometry Geo_CreateCylinder(f32 radius, f32 height, u32 resolution); +Geometry Geo_CreateCone(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 -- cgit v1.2.3-70-g09d2