summaryrefslogtreecommitdiff
path: root/core/math
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2019-09-09 17:50:51 -0300
committerJuan Linietsky <reduzio@gmail.com>2020-02-11 12:01:21 +0100
commit9d7b7f931b6924399903e4954a0c32d59c15d4c3 (patch)
tree9e20293eab891fea4c5441fe5679ec2f79bced00 /core/math
parent69e83e4815545e485350505668a4b9b83346f5bc (diff)
Reflection probes working
Diffstat (limited to 'core/math')
-rw-r--r--core/math/camera_matrix.cpp4
-rw-r--r--core/math/camera_matrix.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/core/math/camera_matrix.cpp b/core/math/camera_matrix.cpp
index 070616f061..9e2d10c1f6 100644
--- a/core/math/camera_matrix.cpp
+++ b/core/math/camera_matrix.cpp
@@ -512,7 +512,7 @@ CameraMatrix CameraMatrix::operator*(const CameraMatrix &p_matrix) const {
return new_matrix;
}
-void CameraMatrix::set_depth_correction() {
+void CameraMatrix::set_depth_correction(bool p_flip_y) {
real_t *m = &matrix[0][0];
@@ -521,7 +521,7 @@ void CameraMatrix::set_depth_correction() {
m[2] = 0.0;
m[3] = 0.0;
m[4] = 0.0;
- m[5] = -1;
+ m[5] = p_flip_y ? -1 : 1;
m[6] = 0.0;
m[7] = 0.0;
m[8] = 0.0;
diff --git a/core/math/camera_matrix.h b/core/math/camera_matrix.h
index 2a25109367..b5c75ca562 100644
--- a/core/math/camera_matrix.h
+++ b/core/math/camera_matrix.h
@@ -50,7 +50,7 @@ struct CameraMatrix {
void set_identity();
void set_zero();
void set_light_bias();
- void set_depth_correction();
+ void set_depth_correction(bool p_flip_y = true);
void set_light_atlas_rect(const Rect2 &p_rect);
void set_perspective(real_t p_fovy_degrees, real_t p_aspect, real_t p_z_near, real_t p_z_far, bool p_flip_fov = false);
void set_perspective(real_t p_fovy_degrees, real_t p_aspect, real_t p_z_near, real_t p_z_far, bool p_flip_fov, int p_eye, real_t p_intraocular_dist, real_t p_convergence_dist);