summaryrefslogtreecommitdiffhomepage
path: root/examples/core_oculus_rift.c
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2016-10-10 19:43:27 +0200
committerraysan5 <[email protected]>2016-10-10 19:43:27 +0200
commit648676f46b01327f0fbd6f017292a3159ea9ab2f (patch)
tree0abbf24e6c394472cad3290ef10f3b8d5bf8f87a /examples/core_oculus_rift.c
parent5fecf5c088122dc409bd209b08627e671cbdc175 (diff)
downloadraylib-648676f46b01327f0fbd6f017292a3159ea9ab2f.tar.gz
raylib-648676f46b01327f0fbd6f017292a3159ea9ab2f.zip
Update examples to new camera system
Diffstat (limited to 'examples/core_oculus_rift.c')
-rw-r--r--examples/core_oculus_rift.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/core_oculus_rift.c b/examples/core_oculus_rift.c
index 3d8bb278..7276e3de 100644
--- a/examples/core_oculus_rift.c
+++ b/examples/core_oculus_rift.c
@@ -30,14 +30,14 @@ int main()
// Define the camera to look into our 3d world
Camera camera;
- camera.position = (Vector3){ 5.0f, 5.0f, 5.0f }; // Camera position
- camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera looking at point
+ camera.position = (Vector3){ 5.0f, 2.0f, 5.0f }; // Camera position
+ camera.target = (Vector3){ 0.0f, 2.0f, 0.0f }; // Camera looking at point
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
camera.fovy = 60.0f; // Camera field-of-view Y
Vector3 cubePosition = { 0.0f, 0.0f, 0.0f };
- SetCameraMode(camera, CAMERA_FIRST_PERSON);
+ SetCameraMode(camera, CAMERA_FIRST_PERSON); // Set first person camera mode
SetTargetFPS(90); // Set our game to run at 90 frames-per-second
//--------------------------------------------------------------------------------------
@@ -47,10 +47,10 @@ int main()
{
// Update
//----------------------------------------------------------------------------------
- if (IsVrSimulator()) UpdateCamera(&camera);
- else UpdateVrTracking();
+ if (IsVrSimulator()) UpdateCamera(&camera); // Update camera (simulator mode)
+ else UpdateVrTracking(&camera); // Update camera with device tracking data
- if (IsKeyPressed(KEY_SPACE)) ToggleVrMode();
+ if (IsKeyPressed(KEY_SPACE)) ToggleVrMode(); // Toggle VR mode
//----------------------------------------------------------------------------------
// Draw