aboutsummaryrefslogtreecommitdiff
path: root/src/gyroscope.c
diff options
context:
space:
mode:
authornathansmithsmith <nathansmith7@mailfence.com>2023-09-23 21:25:54 -0600
committernathansmithsmith <nathansmith7@mailfence.com>2023-09-23 21:25:54 -0600
commitc8132c56f0d1d712e4841a60f9f0f853e7177715 (patch)
treee770618d1d3acd7f2768c51ad497e318d1dbd286 /src/gyroscope.c
parent6ba19e2332162de3225d60ae2a377a894ab7299f (diff)
Radar working
Diffstat (limited to 'src/gyroscope.c')
-rw-r--r--src/gyroscope.c15
1 files changed, 4 insertions, 11 deletions
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(