Added AABB Point

This commit is contained in:
2021-08-17 08:25:20 -07:00
parent 0557ba3274
commit 41c460b90b
20 changed files with 310 additions and 55 deletions

View File

@ -51,6 +51,9 @@
// Locales
#include "locale/language.h"
// Physics
#include "physics/aabb.h"
// Poker Game Logic
#include "poker/turn.h"
#include "poker/bet.h"

View File

@ -19,6 +19,10 @@
#define INPUT_DEBUG_PLUS (inputbind_t)0x08
#define INPUT_DEBUG_MINUS (inputbind_t)0x09
/** Reserved Inputs (Starts at 64) */
#define INPUT_MOUSE_X (inputbind_t)0x40
#define INPUT_MOUSE_Y (inputbind_t)0x41
/** Real Inputs (Starts at 128/0x80) */
#define INPUT_UP (inputbind_t)0x80
#define INPUT_DOWN (inputbind_t)0x81
@ -26,9 +30,8 @@
#define INPUT_RIGHT (inputbind_t)0x83
#define INPUT_ACCEPT (inputbind_t)0x84
#define INPUT_BIND_COUNT 0xFF
#define INPUT_SOURCE_COUNT 0xFF
#define INPUT_SOURCE_COUNT 1024
/**
* Input Bind, a specific action bind reference for the game engine to use.
@ -41,7 +44,7 @@ typedef uint8_t inputbind_t;
* hell this number refers to. For most platforms it will be an input, such as a
* keyboard scancode or a (pad number * button count) + button.
*/
typedef uint8_t inputsource_t;
typedef uint16_t inputsource_t;
/**
* Value that represents the state of an input. Defined as 0-1 where 0 is set

View File

@ -16,6 +16,7 @@
#endif
#if SETTING_PLATFORM == SETTING_PLATFORM_GLFW
#include <GLFW/glfw3.h>
#elif SETTING_PLATFORM == SETTING_PLATFORM_SDL
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
@ -41,6 +42,7 @@
#include <stdbool.h>
#include <malloc.h>
#include <string.h>
#include <math.h>
#if defined(_WIN32) || defined(_WIN64)
// Windows Fixes
@ -48,5 +50,4 @@
# define sleep(n) _sleep(n)
#else
#include <unistd.h>
#include <math.h>
#endif

View File

@ -0,0 +1,16 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
typedef struct {
float hitX;
float hitY;
float normalX;
float normalY;
} aabbpointhit_t;

View File

@ -15,4 +15,5 @@
#define mathMin(a,b) (a>b?b:a)
#define mathAbs(n) (n<0?-n:n)
#define mathDeg2Rad(n) (n * M_PI / 180.0)
#define mathRad2Deg(n) (n * 180 / M_PI)
#define mathRad2Deg(n) (n * 180 / M_PI)
#define mathSign(n) (n>=0 ? 1 : -1)