Commit 43396bef authored by Robert Menzel's avatar Robert Menzel

added option to modify the FoV in a Rift relative to the native FoV

parent 5cf28612
......@@ -86,6 +86,9 @@ public:
//! default is 0.03f, should be no more than the rendering latency!
void setPrediction( float _seconds );
void setFoVMultiplier( float _factor ) { mFoVMultiplier = _factor; updateCameraFoV(); }
float getFoVMultiplier() { return mFoVMultiplier; }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// RAW parameters for distortion rendering:
......@@ -207,6 +210,7 @@ private:
OVR::Quatf mInverseNeutralRotation; // as quaternion
float mPredictionTime;
float mFoVMultiplier;
};
ACGL_SMARTPOINTER_TYPEDEFS(SimpleRiftController)
......
......@@ -39,6 +39,7 @@ SimpleRiftController::SimpleRiftController( uint32_t _riftnumber, bool _performA
mUseChromaticAberation = true;
mPredictionTime = -1.0f;
mFoVMultiplier = 1.0f;
mCamera = SharedHMDCamera(); // set to NULL
attachCamera( SharedHMDCamera( new HMDCamera() ) ); // attach a blank camera
......@@ -195,9 +196,6 @@ glm::mat3 SimpleRiftController::getCurrentRotation()
if (mORSensorFusion.IsYawCorrectionEnabled()) {
//debug() << "yaw corrected" << endl;
}
if (mMagneticCalibration.IsCalibrated()) {
//debug() << "calibrated" << endl;
}
Matrix4f orientation( q );
return riftMatrixToGLM( orientation );
......@@ -231,6 +229,10 @@ void SimpleRiftController::updateCameraFoV()
float vfov = 2.0f * atan( percievedHalfRTDist/mORHMDInfo.EyeToScreenDistance );
vfov = ACGL::Math::Functions::calcRadToDeg( vfov );
vfov *= mFoVMultiplier;
if (vfov < 5.0f) vfov = 5.0f;
if (vfov >= 175.0f) vfov = 175.0f;
mCamera->setVerticalFieldOfView( vfov );
debug() << "update VFoV: " << vfov << endl;
}
......
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