33 lines
683 B
C
33 lines
683 B
C
/**
|
|
* 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
|
|
); |