aboutsummaryrefslogtreecommitdiff
path: root/src/gyroscope.c
diff options
context:
space:
mode:
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(