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:
parent
a0e0c47701
commit
fb4c1d38eb
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue