diff options
author | Juan Linietsky <reduzio@gmail.com> | 2020-08-13 11:48:21 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-13 11:48:21 -0300 |
commit | d84b28b94f26db0ea115baf92662b09e6d6db67b (patch) | |
tree | a5a9d4a388b9913d098d058f06547de51e8dfeeb /core | |
parent | 64d859df0c6ba51ea4c4841e0a1eb287c5079eae (diff) | |
parent | 079ca220e14669ef7c31c399985cd2c733af15bd (diff) |
Merge pull request #41213 from reduz/volumetric-fog
Added volumetric fog effect.
Diffstat (limited to 'core')
-rw-r--r-- | core/math/camera_matrix.cpp | 5 | ||||
-rw-r--r-- | core/math/camera_matrix.h | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/core/math/camera_matrix.cpp b/core/math/camera_matrix.cpp index 22ab83f358..c154d57a13 100644 --- a/core/math/camera_matrix.cpp +++ b/core/math/camera_matrix.cpp @@ -278,7 +278,7 @@ Vector2 CameraMatrix::get_viewport_half_extents() const { return Vector2(res.x, res.y); } -void CameraMatrix::get_far_plane_size(real_t &r_width, real_t &r_height) const { +Vector2 CameraMatrix::get_far_plane_half_extents() const { const real_t *matrix = (const real_t *)this->matrix; ///////--- Far Plane ---/////// Plane far_plane = Plane(matrix[3] - matrix[2], @@ -303,8 +303,7 @@ void CameraMatrix::get_far_plane_size(real_t &r_width, real_t &r_height) const { Vector3 res; far_plane.intersect_3(right_plane, top_plane, &res); - r_width = res.x; - r_height = res.y; + return Vector2(res.x, res.y); } bool CameraMatrix::get_endpoints(const Transform &p_transform, Vector3 *p_8points) const { diff --git a/core/math/camera_matrix.h b/core/math/camera_matrix.h index 49fdecae02..c5cdd98377 100644 --- a/core/math/camera_matrix.h +++ b/core/math/camera_matrix.h @@ -74,7 +74,7 @@ struct CameraMatrix { bool get_endpoints(const Transform &p_transform, Vector3 *p_8points) const; Vector2 get_viewport_half_extents() const; - void get_far_plane_size(real_t &r_width, real_t &r_height) const; + Vector2 get_far_plane_half_extents() const; void invert(); CameraMatrix inverse() const; |