3
0
Fork 0
mirror of https://thingvellir.net/git/overte synced 2025-03-27 23:52:03 +01:00

Set Oculus camera fov/aspect ratio.

This commit is contained in:
Andrzej Kapolka 2014-11-04 19:04:31 -08:00
parent a0e0c47701
commit fb4c1d38eb

View file

@ -126,6 +126,7 @@ void OculusManager::connect() {
if (!_camera) {
_camera = new Camera;
configureCamera(*_camera, 0, 0); // no need to use screen dimensions; they're ignored
}
if (!_programInitialized) {
@ -420,7 +421,7 @@ void OculusManager::endFrameTiming() {
//Sets the camera FoV and aspect ratio
void OculusManager::configureCamera(Camera& camera, int screenWidth, int screenHeight) {
#ifdef HAVE_LIBOVR
camera.setAspectRatio((float)_renderTargetSize.w / _renderTargetSize.h);
camera.setAspectRatio(_renderTargetSize.w * 0.5f / _renderTargetSize.h);
camera.setFieldOfView(atan(_eyeFov[0].UpTan) * DEGREES_PER_RADIAN * 2.0f);
#endif
}