tweaks to ViewFrustum's default FOV, added comments

This commit is contained in:
ZappoMan 2013-04-13 13:09:20 -07:00
parent 093f489520
commit 4cb986b3f9
2 changed files with 12 additions and 1 deletions

View file

@ -10,6 +10,8 @@
#include "ViewFrustum.h"
float ViewFrustum::fovAngleAdust=1.75;
ViewFrustum::ViewFrustum(glm::vec3 position, glm::vec3 direction,
glm::vec3 up, glm::vec3 right, float screenWidth, float screenHeight) {
this->calculateViewFrustum(position, direction, up, right, screenWidth, screenHeight);
@ -36,7 +38,14 @@ void ViewFrustum::calculateViewFrustum(glm::vec3 position, glm::vec3 direction,
this->_screenHeight = screenHeight;
glm::vec3 front = direction;
float fovHalfAngle = 0.7854f * 1.5; // 45 deg and some hackery. Still trying to figure out our correct fov
// Calculating field of view.
// 0.7854f is 45 deg
// ViewFrustum::fovAngleAdust defaults to 1.75
// Apparently our fov is around 1.75 times this value or 78.75 degrees
// you can adjust this in interface by using the "|" and "\" keys to tweak
// the adjustment and see effects of different FOVs
float fovHalfAngle = 0.7854f * ViewFrustum::fovAngleAdust;
float ratio = screenWidth / screenHeight;
this->_nearDist = 0.1;

View file

@ -61,6 +61,8 @@ public:
glm::vec3 up, glm::vec3 right, float screenWidth, float screenHeight);
void dump();
static float fovAngleAdust;
};