Commit 4321f480 authored by Janis Born's avatar Janis Born

fix possible crash in SimpleRiftController when no HMD is connected

parent 4c015e71
...@@ -150,15 +150,16 @@ SimpleRiftController::~SimpleRiftController() ...@@ -150,15 +150,16 @@ SimpleRiftController::~SimpleRiftController()
void SimpleRiftController::setPrediction( float _seconds ) void SimpleRiftController::setPrediction( float _seconds )
{ {
if ( _seconds >= 0.0f ) { if(getSuccessfulConnected()) {
mORSensorFusion->SetPrediction( _seconds ); if ( _seconds >= 0.0f ) {
} else { mORSensorFusion->SetPrediction( _seconds );
mORSensorFusion->SetPrediction( 0.0f, false ); } else {
mORSensorFusion->SetPrediction( 0.0f, false );
}
mPredictionTime = _seconds;
} }
mPredictionTime = _seconds;
} }
glm::mat4 SimpleRiftController::getProjectionMatrixFromCamera() glm::mat4 SimpleRiftController::getProjectionMatrixFromCamera()
{ {
if (!mCamera) return glm::mat4(); if (!mCamera) return glm::mat4();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment