From 84a940d04688cc55d3d4f573b77da599d086a787 Mon Sep 17 00:00:00 2001 From: Sara Date: Sat, 25 Nov 2023 21:51:33 +0100 Subject: [PATCH] feat(physics): added physics.h header for some physics-system-wide definitions --- core/src/physics.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 core/src/physics.h diff --git a/core/src/physics.h b/core/src/physics.h new file mode 100644 index 0000000..0bc1569 --- /dev/null +++ b/core/src/physics.h @@ -0,0 +1,30 @@ +#ifndef _fencer_physics_h +#define _fencer_physics_h + +#include "vmath.h" +#include "transform.h" +#include "stdint.h" +#include "physics_entity.h" + +typedef uint32_t PhysicsMask; + +typedef struct Collision { + struct Collider* other; + + Vector point; + Vector normal; + + Vector velocity; + Vector penetration_vector; + + Vector edge_left; + Vector edge_right; +} Collision; + +typedef struct PhysicsQuery { + Shape* shape; + Transform* transform; + PhysicsMask mask; +} PhysicsQuery; + +#endif // !_fencer_physics_h