#ifndef PLAYER_H_
#define PLAYER_H_

float get_terrain_height(float x, float z, int width, int height, float grid_size);
int check_collision(float x, float y, float z, int width, int height, float grid_size);

typedef struct {
    float min_x, min_y, min_z;
    float max_x, max_y, max_z;
} AABB;

int aabb_normal(AABB player, AABB block, float* normal_x, float* normal_y, float* normal_z);
int aabb_collide(AABB a, AABB b);
extern int stairSteps;
extern int initStairs;
extern float *block_colliders;
int checkBlockColliders(AABB player_aabb, float *rh);

extern float speed;
extern float strifeSpeed;
extern float rotSpeed;
extern float speedMulti;

extern float velocityY;
extern int isGrounded;
extern float gravityCalc;
extern bool isJumping;
extern int isSwimming;
extern int moveMode; // 0 = free mode, 1 = player mode
extern int applyXoffset;
extern bool readyXoffset;

extern bool swapStrife;

void handle_move(); // fixed movement ticks update()


int RenderSpinningQuad();

void RenderCube();

int RenderBlock(Vec3 *pos, Vec3 *scale);
int RenderStair(); // blocks

// get direction moved to custom.c
#endif
