diff options
Diffstat (limited to 'src/cameras.c')
-rw-r--r-- | src/cameras.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/cameras.c b/src/cameras.c index 1cf6cee..dc1afd0 100644 --- a/src/cameras.c +++ b/src/cameras.c @@ -19,6 +19,7 @@ void updateFirstPersonCamera(Game * game, Camera3D * camera) { camera->up = Vector3RotateByQuaternion((Vector3){0.0, 1.0, 0.0}, player->rotation); } +// Third person hehehe. void initThirdPersonCamera(Game * game, Camera3D * camera) { *camera = (Camera3D){ .fovy = 90.0, @@ -35,15 +36,32 @@ void updateThirdPersonCamera(Game * game, Camera3D * camera) { camera->up = Vector3RotateByQuaternion((Vector3){0.0, 1.0, 0.0}, player->rotation); } +// KILL THE BUGS!!! +void initDebugCamera(Game * game, Camera3D * camera) { + *camera = (Camera3D){ + .fovy = 120.0, + .projection = CAMERA_PERSPECTIVE, + .position = DEBUG_CAMERA_POSITION, + .up = (Vector3){0.0, 1.0, 0.0} + }; +} + +void updateDebugCamera(Game * game, Camera3D * camera) { + Entity * player = getEntityFromWorld(game->world, 0); + camera->target = player->position; +} + // Callbacks indeed. const CameraInitCb cameraInitCallbacks[CAMERA_COUNT] = { initFirstPersonCamera, - initThirdPersonCamera + initThirdPersonCamera, + initDebugCamera }; const CameraCb cameraCallbacks[CAMERA_COUNT] = { updateFirstPersonCamera, - updateThirdPersonCamera + updateThirdPersonCamera, + updateDebugCamera }; void initCameras(Game * game, Cameras cameras) { |