summaryrefslogtreecommitdiff
path: root/src/systems
diff options
context:
space:
mode:
authoromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-04-27 11:25:48 +1000
committeromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-04-27 11:25:48 +1000
commit8dae0a94059bd21a5a10e4434cadc843126d8b05 (patch)
treed8d110e0a4a2a03e1e9d6c3b7a2dbf53a9d9e858 /src/systems
parent7a8d93d2b867cab853ecf8c4ec5061cdc5cab665 (diff)
parentf8375e4587612d6a582eb053be5a67694a59993d (diff)
Merge branch 'brainstorming-systems' into ral
Diffstat (limited to 'src/systems')
-rw-r--r--src/systems/physics.c1
-rw-r--r--src/systems/physics.h33
2 files changed, 34 insertions, 0 deletions
diff --git a/src/systems/physics.c b/src/systems/physics.c
new file mode 100644
index 0000000..299c0c1
--- /dev/null
+++ b/src/systems/physics.c
@@ -0,0 +1 @@
+#include "physics.h" \ No newline at end of file
diff --git a/src/systems/physics.h b/src/systems/physics.h
new file mode 100644
index 0000000..5c96c6e
--- /dev/null
+++ b/src/systems/physics.h
@@ -0,0 +1,33 @@
+#pragma once
+
+#include "maths_types.h"
+
+// 'system' means that it gets called per frame
+
+typedef struct physics_settings {
+ f32 gravity_strength;
+} physics_settings;
+
+enum collider_type {
+ cuboid_collider,
+ sphere_collider,
+};
+
+/** @brief generic collider structure */
+typedef struct physics_collider {
+ u64 id; // ? Replace with handle?
+ enum collider_type shape;
+ transform transform;
+ u8 layer;
+ bool on_ground;
+} physics_collider;
+
+typedef struct physics_world {
+ physics_settings settings;
+} physics_world;
+
+physics_world physics_init(physics_settings settings);
+void physics_shutdown(physics_world* phys_world);
+
+/** @brief perform one or more simulation steps */
+void physics_system_update(physics_world* phys_world, f64 deltatime); \ No newline at end of file