Physics I guess

This commit is contained in:
2025-09-15 19:37:01 -05:00
parent 07ab2b4b02
commit f799690d3c
25 changed files with 315 additions and 13 deletions

View File

@@ -0,0 +1,33 @@
/**
* Copyright (c) 2025 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "dusk.h"
typedef struct physicscircle_s {
vec2 position;
float_t radius;
} physicscircle_t;
typedef struct physicscirclecircleresult_s {
bool_t hit;
vec2 normal;
float_t depth;
} physicscirclecircleresult_t;
/**
* Check for collision between two circles.
*
* @param a The first circle.
* @param b The second circle.
* @param out Pointer to the result structure to populate.
*/
void physicsCircleCheckCircle(
const physicscircle_t a,
const physicscircle_t b,
physicscirclecircleresult_t *out
);