// playerController.h #ifndef PLAYER_CONTROLLER_H #define PLAYER_CONTROLLER_H #include "raylib.h" #include "chunkStructures.h" #include "world.h" typedef struct { Vector3 mapPosition; // Player's world position (camera position) Vector2 playerOrientation; // Yaw (x) and pitch (y), in radians Vector3 forward; // Direction vector computed from yaw/pitch Vector3 right; // Right vector float moveSpeed; // Movement speed Camera3D camera; } Player; void UpdatePlayer(Player *player); typedef struct { bool hit; Vector3 position; int hitBlockX, hitBlockY, hitBlockZ; Vector3 normal; int blockID; float t; int chunkX; int chunkZ; } RaycastHit; RaycastHit RaycastChunk(const Chunk *chunk, Vector3 origin, Vector3 direction, float maxDistance); RaycastHit GetPlayerRaycastHit(Player *player, World *world, float maxDistance); // Osolete with multichunk worlds. //RaycastHit GetPlayerRaycastHit(Player *player, Chunk *chunk, float maxDistance); void UpdateFreeCamera(Camera3D *cam, float speed, float *yawOut, float *pitchOut); void DrawFaceHighlight(Vector3 blockPos, Vector3 normal); void HandleBlockInteraction(Player *player, Chunk *chunk, RaycastHit hit, int blockSelection); #endif