diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-05 08:35:26 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-05 08:35:26 +0200 |
commit | 3a2b0ab73d4cfbed769d46517f1f4832a975a979 (patch) | |
tree | d62a72796aaa2a80e0a70b19d7bafac4d610a2b0 /core/math/projection.h | |
parent | 132a0e3242a54cd0750769b8f057ae8e0fd58232 (diff) | |
parent | 2cea42cc7faf12ad56b12c113bbb70521264c8e8 (diff) | |
download | redot-engine-3a2b0ab73d4cfbed769d46517f1f4832a975a979.tar.gz |
Merge pull request #66898 from aaronfranke/proj-mat-columns
Rename Projection `matrix` to `columns`
Diffstat (limited to 'core/math/projection.h')
-rw-r--r-- | core/math/projection.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/core/math/projection.h b/core/math/projection.h index f149d307b3..1bf5d8b2ed 100644 --- a/core/math/projection.h +++ b/core/math/projection.h @@ -52,16 +52,16 @@ struct Projection { PLANE_BOTTOM }; - Vector4 matrix[4]; + Vector4 columns[4]; _FORCE_INLINE_ const Vector4 &operator[](const int p_axis) const { DEV_ASSERT((unsigned int)p_axis < 4); - return matrix[p_axis]; + return columns[p_axis]; } _FORCE_INLINE_ Vector4 &operator[](const int p_axis) { DEV_ASSERT((unsigned int)p_axis < 4); - return matrix[p_axis]; + return columns[p_axis]; } float determinant() const; @@ -135,7 +135,7 @@ struct Projection { bool operator==(const Projection &p_cam) const { for (uint32_t i = 0; i < 4; i++) { for (uint32_t j = 0; j < 4; j++) { - if (matrix[i][j] != p_cam.matrix[i][j]) { + if (columns[i][j] != p_cam.columns[i][j]) { return false; } } @@ -157,10 +157,10 @@ struct Projection { Vector3 Projection::xform(const Vector3 &p_vec3) const { Vector3 ret; - ret.x = matrix[0][0] * p_vec3.x + matrix[1][0] * p_vec3.y + matrix[2][0] * p_vec3.z + matrix[3][0]; - ret.y = matrix[0][1] * p_vec3.x + matrix[1][1] * p_vec3.y + matrix[2][1] * p_vec3.z + matrix[3][1]; - ret.z = matrix[0][2] * p_vec3.x + matrix[1][2] * p_vec3.y + matrix[2][2] * p_vec3.z + matrix[3][2]; - real_t w = matrix[0][3] * p_vec3.x + matrix[1][3] * p_vec3.y + matrix[2][3] * p_vec3.z + matrix[3][3]; + ret.x = columns[0][0] * p_vec3.x + columns[1][0] * p_vec3.y + columns[2][0] * p_vec3.z + columns[3][0]; + ret.y = columns[0][1] * p_vec3.x + columns[1][1] * p_vec3.y + columns[2][1] * p_vec3.z + columns[3][1]; + ret.z = columns[0][2] * p_vec3.x + columns[1][2] * p_vec3.y + columns[2][2] * p_vec3.z + columns[3][2]; + real_t w = columns[0][3] * p_vec3.x + columns[1][3] * p_vec3.y + columns[2][3] * p_vec3.z + columns[3][3]; return ret / w; } |