From c8132c56f0d1d712e4841a60f9f0f853e7177715 Mon Sep 17 00:00:00 2001 From: nathansmithsmith Date: Sat, 23 Sep 2023 21:25:54 -0600 Subject: Radar working --- src/gyroscope.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src/gyroscope.c') diff --git a/src/gyroscope.c b/src/gyroscope.c index 980345c..7b6ee76 100644 --- a/src/gyroscope.c +++ b/src/gyroscope.c @@ -7,11 +7,9 @@ void initGyroscope(Gyroscope * gyroscope) { resetGyroscopePosition(gyroscope); gyroscope->camera = (Camera3D){ - .fovy = 45, + .fovy = 45.0, .projection = CAMERA_PERSPECTIVE, - .position = (Vector3){0.0, 0.0, 3.0}, .target = Vector3Zero(), - .up = (Vector3){0.0, 1.0, 0.0} }; gyroscope->texture = LoadRenderTexture( @@ -36,7 +34,7 @@ void resetGyroscopePosition(Gyroscope * gyroscope) { } void updateGyroscopeRotation(Entity * player, Gyroscope * gyroscope) { - // Instead of rotation the gyroscope ball we rotate the camera around it. + // Instead of rotating the gyroscope ball we rotate the camera around it. gyroscope->camera.position = Vector3Scale( Vector3RotateByQuaternion((Vector3){0.0, 0.0, 1.0}, player->rotation), GYROSCOPE_CAMERA_DISTANCE @@ -58,19 +56,14 @@ void drawGyroscope(Game * game, Gyroscope * gyroscope) { ClearBackground(BLACK); BeginMode3D(gyroscope->camera); - // Set transform and draw. + // This this fucker!!! DrawModel(model, Vector3Zero(), 1, WHITE); EndMode3D(); EndTextureMode(); // Draw render texture. - DrawTexture( - gyroscope->texture.texture, - gyroscope->position.x, - gyroscope->position.y, - WHITE - ); + DrawTextureV(gyroscope->texture.texture, gyroscope->position, WHITE); // Top to bottom. DrawLineEx( -- cgit v1.2.3