diff options
| author | Juan Linietsky | 2014-09-15 20:06:37 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2014-09-15 20:06:37 -0300 |
| commit | 642c63319eb7471c9accc0c50dfffef5d72c0078 (patch) | |
| tree | 6d1a3c4ee4a591d9dc9ec9bdbf4054d66ea61774 /core/math/camera_matrix.cpp | |
| parent | 8cab401d08f8e25aa9b2dc710204785858ff3dbb (diff) | |
| download | godot-642c63319eb7471c9accc0c50dfffef5d72c0078.tar.gz godot-642c63319eb7471c9accc0c50dfffef5d72c0078.tar.zst godot-642c63319eb7471c9accc0c50dfffef5d72c0078.zip | |
Diffstat (limited to 'core/math/camera_matrix.cpp')
| -rw-r--r-- | core/math/camera_matrix.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/math/camera_matrix.cpp b/core/math/camera_matrix.cpp index 52d77b6eb..a60dea737 100644 --- a/core/math/camera_matrix.cpp +++ b/core/math/camera_matrix.cpp @@ -67,9 +67,10 @@ Plane CameraMatrix::xform4(const Plane& p_vec4) { void CameraMatrix::set_perspective(float p_fovy_degrees, float p_aspect, float p_z_near, float p_z_far,bool p_flip_fov) { - if (p_flip_fov) - p_fovy_degrees=get_fovy(p_fovy_degrees,p_aspect); + if (p_flip_fov) { + p_fovy_degrees=get_fovy(p_fovy_degrees,1.0/p_aspect); + } float sine, cotangent, deltaZ; float radians = p_fovy_degrees / 2.0 * Math_PI / 180.0; @@ -110,7 +111,7 @@ void CameraMatrix::set_orthogonal(float p_left, float p_right, float p_bottom, f void CameraMatrix::set_orthogonal(float p_size, float p_aspect, float p_znear, float p_zfar,bool p_flip_fov) { - if (p_flip_fov) { + if (!p_flip_fov) { p_size*=p_aspect; } |
