Rename Projection matrix to columns
This commit is contained in:
parent
0056acf46f
commit
2cea42cc7f
25 changed files with 284 additions and 282 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue