diff options
author | Omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-02-24 23:04:48 +1100 |
---|---|---|
committer | Omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-02-24 23:04:48 +1100 |
commit | fb070f793e36932e052af8eee73c57703d90ce98 (patch) | |
tree | a2d10d733bb3d152ef0b2ad1af00d04387428133 | |
parent | b38313c518d99a43c8a2438ea20f1cf84636d794 (diff) |
add shape definitions
-rw-r--r-- | src/maths/geometry.h | 50 | ||||
-rw-r--r-- | src/systems/screenspace.h | 2 |
2 files changed, 51 insertions, 1 deletions
diff --git a/src/maths/geometry.h b/src/maths/geometry.h new file mode 100644 index 0000000..6f4797b --- /dev/null +++ b/src/maths/geometry.h @@ -0,0 +1,50 @@ +/** + * @file geometry.h + * @author your name (you@domain.com) + * @brief Shapes and intersections between them + * @version 0.1 + * @date 2024-02-24 + * + * @copyright Copyright (c) 2024 + */ +#pragma once + +#include "maths.h" + +typedef struct line_3d { + vec3 start, end; +} line_3d; + +typedef struct plane { + vec3 normal; +} plane; + +typedef struct cuboid { + vec3 half_extents; +} cuboid; + +typedef struct sphere { + f32 radius; +} sphere; + +typedef struct cylinder { + f32 radius; + f32 half_height; +} cylinder; + +typedef struct cone { + f32 radius; + f32 half_height; +} cone; + +// TODO: +// capsule +// torus +// ray +// frustum +// conical frustum +// wedge + +// 2d... +// line +// circle
\ No newline at end of file diff --git a/src/systems/screenspace.h b/src/systems/screenspace.h index d36404a..2250847 100644 --- a/src/systems/screenspace.h +++ b/src/systems/screenspace.h @@ -37,7 +37,7 @@ KITC_DECL_TYPED_ARRAY(draw_cmd) typedef struct screenspace_state { u32 rect_vbo; u32 rect_vao; - // shader rect_shader; + shader rect_shader; draw_cmd_darray* draw_cmd_buf; } screenspace_state; |