summaryrefslogtreecommitdiffstats
path: root/core/math/camera_matrix.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-09-12 11:16:36 +0200
committerGitHub <noreply@github.com>2017-09-12 11:16:36 +0200
commit3941e01a57653e6b2edb8f056f657f4ae9d569b0 (patch)
tree187dcae4f455608e2c2edf9bd9ecb71454b43209 /core/math/camera_matrix.cpp
parentcbe7c23afe0910e9ee50e198fdb3170214315ed7 (diff)
parent5e18967d7730f162aa111b2972e3fdc80ee52579 (diff)
downloadredot-engine-3941e01a57653e6b2edb8f056f657f4ae9d569b0.tar.gz
Merge pull request #11041 from hpvb/fix-clang-format-error
Fix serveral recent new clang-format errors [ci skip]
Diffstat (limited to 'core/math/camera_matrix.cpp')
-rw-r--r--core/math/camera_matrix.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/core/math/camera_matrix.cpp b/core/math/camera_matrix.cpp
index 572a6c5239..b7a929c8e0 100644
--- a/core/math/camera_matrix.cpp
+++ b/core/math/camera_matrix.cpp
@@ -266,27 +266,26 @@ void CameraMatrix::get_viewport_size(real_t &r_width, real_t &r_height) const {
bool CameraMatrix::get_endpoints(const Transform &p_transform, Vector3 *p_8points) const {
Vector<Plane> planes = get_projection_planes(Transform());
- const Planes intersections[8][3]={
- {PLANE_FAR,PLANE_LEFT,PLANE_TOP},
- {PLANE_FAR,PLANE_LEFT,PLANE_BOTTOM},
- {PLANE_FAR,PLANE_RIGHT,PLANE_TOP},
- {PLANE_FAR,PLANE_RIGHT,PLANE_BOTTOM},
- {PLANE_NEAR,PLANE_LEFT,PLANE_TOP},
- {PLANE_NEAR,PLANE_LEFT,PLANE_BOTTOM},
- {PLANE_NEAR,PLANE_RIGHT,PLANE_TOP},
- {PLANE_NEAR,PLANE_RIGHT,PLANE_BOTTOM},
+ const Planes intersections[8][3] = {
+ { PLANE_FAR, PLANE_LEFT, PLANE_TOP },
+ { PLANE_FAR, PLANE_LEFT, PLANE_BOTTOM },
+ { PLANE_FAR, PLANE_RIGHT, PLANE_TOP },
+ { PLANE_FAR, PLANE_RIGHT, PLANE_BOTTOM },
+ { PLANE_NEAR, PLANE_LEFT, PLANE_TOP },
+ { PLANE_NEAR, PLANE_LEFT, PLANE_BOTTOM },
+ { PLANE_NEAR, PLANE_RIGHT, PLANE_TOP },
+ { PLANE_NEAR, PLANE_RIGHT, PLANE_BOTTOM },
};
- for(int i=0;i<8;i++) {
+ for (int i = 0; i < 8; i++) {
Vector3 point;
- bool res = planes[intersections[i][0]].intersect_3(planes[intersections[i][1]],planes[intersections[i][2]], &point);
+ bool res = planes[intersections[i][0]].intersect_3(planes[intersections[i][1]], planes[intersections[i][2]], &point);
ERR_FAIL_COND_V(!res, false);
- p_8points[i]=p_transform.xform(point);
+ p_8points[i] = p_transform.xform(point);
}
return true;
-
}
Vector<Plane> CameraMatrix::get_projection_planes(const Transform &p_transform) const {
@@ -564,10 +563,9 @@ int CameraMatrix::get_pixels_per_meter(int p_for_pixel_width) const {
bool CameraMatrix::is_orthogonal() const {
- return matrix[3][3]==1.0;
+ return matrix[3][3] == 1.0;
}
-
real_t CameraMatrix::get_fov() const {
const real_t *matrix = (const real_t *)this->matrix;