This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Frustum Camera::CalculateFrustum(float fnear, float ffar) { | |
Frustum returnFrustum; | |
// Calculate the near and far plane points | |
float nearHeight = 2 * tan(fov / 2) * fnear; | |
float nearWidth = nearHeight * aspect; | |
float farHeight = 2 * tan(fov / 2) * ffar; | |
float farWidth = farHeight * aspect; | |
// And their centers |