Physics I guess
This commit is contained in:
33
src/physics/physicscircle.h
Normal file
33
src/physics/physicscircle.h
Normal 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
|
||||
);
|
||||
Reference in New Issue
Block a user