Add Horizontal to vertical FOV convert and vice versa
This commit is contained in:
@@ -7,11 +7,19 @@
|
||||
#include "Maths.hpp"
|
||||
#include <cmath>
|
||||
|
||||
float Maths::FOVHToV(float fovH, float aspect) {
|
||||
return 2.0f * std::atan(std::tan(fovH * 0.5f * (M_PI / 180.0f)) / aspect) * (180.0f / M_PI);
|
||||
}
|
||||
|
||||
float Maths::FOVVToH(float fovV, float aspect) {
|
||||
return 2.0f * std::atan(std::tan(fovV * 0.5f * (M_PI / 180.0f)) * aspect) * (180.0f / M_PI);
|
||||
}
|
||||
|
||||
double Maths::DegreesToRadians(double degrees) {
|
||||
return degrees * M_PI / 180.0;
|
||||
}
|
||||
|
||||
// Convertit des radians en degrés
|
||||
// Converts radians in degree
|
||||
double Maths::RadiansToDegrees(double radians) {
|
||||
return radians * 180.0 / M_PI;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user