Added prediction for Oculus rift to reduce apparent latency.

This commit is contained in:
barnold1953 2014-05-28 17:13:59 -07:00
parent e6d12bf239
commit 81ed0d99f7

View file

@ -50,6 +50,7 @@ void OculusManager::connect() {
_sensorDevice = *_hmdDevice->GetSensor(); _sensorDevice = *_hmdDevice->GetSensor();
_sensorFusion = new SensorFusion; _sensorFusion = new SensorFusion;
_sensorFusion->AttachToSensor(_sensorDevice); _sensorFusion->AttachToSensor(_sensorDevice);
_sensorFusion->SetPredictionEnabled(true);
HMDInfo info; HMDInfo info;
_hmdDevice->GetDeviceInfo(&info); _hmdDevice->GetDeviceInfo(&info);
@ -201,7 +202,7 @@ void OculusManager::reset() {
void OculusManager::getEulerAngles(float& yaw, float& pitch, float& roll) { void OculusManager::getEulerAngles(float& yaw, float& pitch, float& roll) {
#ifdef HAVE_LIBOVR #ifdef HAVE_LIBOVR
_sensorFusion->GetOrientation().GetEulerAngles<Axis_Y, Axis_X, Axis_Z, Rotate_CCW, Handed_R>(&yaw, &pitch, &roll); _sensorFusion->GetPredictedOrientation().GetEulerAngles<Axis_Y, Axis_X, Axis_Z, Rotate_CCW, Handed_R>(&yaw, &pitch, &roll);
#endif #endif
} }