diff options
| author | Ray <[email protected]> | 2016-10-09 20:56:58 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2016-10-09 20:56:58 +0200 |
| commit | 5af1b4a7c9119cf438e4cb5303009fbe9a25c6d7 (patch) | |
| tree | 77a621bfb79f4fbc27666b366590c00b9eeaab61 /examples/core_oculus_rift.c | |
| parent | 3396743aba163545eb186beb47667d55d38528e9 (diff) | |
| download | raylib-5af1b4a7c9119cf438e4cb5303009fbe9a25c6d7.tar.gz raylib-5af1b4a7c9119cf438e4cb5303009fbe9a25c6d7.zip | |
Added simulated head-tracking on VR simulator
A simple 1st person camera... still requires some work...
Diffstat (limited to 'examples/core_oculus_rift.c')
| -rw-r--r-- | examples/core_oculus_rift.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/core_oculus_rift.c b/examples/core_oculus_rift.c index 88e411d4..3d8bb278 100644 --- a/examples/core_oculus_rift.c +++ b/examples/core_oculus_rift.c @@ -37,6 +37,8 @@ int main() Vector3 cubePosition = { 0.0f, 0.0f, 0.0f }; + SetCameraMode(camera, CAMERA_FIRST_PERSON); + SetTargetFPS(90); // Set our game to run at 90 frames-per-second //-------------------------------------------------------------------------------------- @@ -45,7 +47,8 @@ int main() { // Update //---------------------------------------------------------------------------------- - UpdateVrTracking(); + if (IsVrSimulator()) UpdateCamera(&camera); + else UpdateVrTracking(); if (IsKeyPressed(KEY_SPACE)) ToggleVrMode(); //---------------------------------------------------------------------------------- @@ -61,7 +64,7 @@ int main() DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED); DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON); - DrawGrid(10, 1.0f); + DrawGrid(40, 1.0f); End3dMode(); |
