History

drive body yaw and render pitch with oculus when connected

Stephen Birarda committed 13 years ago

Commit 04447df1 parent adbca702 files · +16 −2Browse files

Showing the changes to interface/src/Camera.cpp (1 of 2 files). Show all

Unified · Split

interface/src/Camera.cpp+9−2
@@ -7,6 +7,7 @@ · 6 unmodified lines
7 7
8#include <SharedUtil.h>8#include <SharedUtil.h>
9#include <VoxelConstants.h>9#include <VoxelConstants.h>
10#include <OculusManager.h>
10// #include "Log.h"11// #include "Log.h"
11 12
12#include "Camera.h"13#include "Camera.h"
@@ -69,8 +70,14 @@ void Camera::updateFollowMode(float deltaTime) { · 56 unmodified lines
69 t = 1.0;70 t = 1.0;
70 }71 }
71 72
72 // update _yaw (before position!) 73 // update _yaw (before position!)
73 _yaw += (_idealYaw - _yaw) * t;74 if (OculusManager::isConnected()) {
75 // if using the oculus, just set the yaw
76 _yaw = _idealYaw;
77 } else {
78 _yaw += (_idealYaw - _yaw) * t;
79 }
80
74 _orientation.yaw(_yaw);81 _orientation.yaw(_yaw);
75 82
76 float radian = (_yaw / 180.0) * PIE;83 float radian = (_yaw / 180.0) * PIE;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t