Skip to content

Commit d72baf1

Browse files
authored
Merge pull request #1742 from aaronfranke/projection-construct
Add missing Projection constructor with 16 `real_t` values
2 parents c2d688b + aa03c32 commit d72baf1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

include/godot_cpp/variant/projection.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ struct [[nodiscard]] Projection {
153153

154154
Projection();
155155
Projection(const Vector4 &p_x, const Vector4 &p_y, const Vector4 &p_z, const Vector4 &p_w);
156+
Projection(real_t p_xx, real_t p_xy, real_t p_xz, real_t p_xw, real_t p_yx, real_t p_yy, real_t p_yz, real_t p_yw, real_t p_zx, real_t p_zy, real_t p_zz, real_t p_zw, real_t p_wx, real_t p_wy, real_t p_wz, real_t p_ww);
156157
Projection(const Transform3D &p_transform);
157158
~Projection();
158159
};

src/variant/projection.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,13 @@ Projection::Projection(const Vector4 &p_x, const Vector4 &p_y, const Vector4 &p_
10371037
columns[3] = p_w;
10381038
}
10391039

1040+
Projection::Projection(real_t p_xx, real_t p_xy, real_t p_xz, real_t p_xw, real_t p_yx, real_t p_yy, real_t p_yz, real_t p_yw, real_t p_zx, real_t p_zy, real_t p_zz, real_t p_zw, real_t p_wx, real_t p_wy, real_t p_wz, real_t p_ww) {
1041+
columns[0] = Vector4(p_xx, p_xy, p_xz, p_xw);
1042+
columns[1] = Vector4(p_yx, p_yy, p_yz, p_yw);
1043+
columns[2] = Vector4(p_zx, p_zy, p_zz, p_zw);
1044+
columns[3] = Vector4(p_wx, p_wy, p_wz, p_ww);
1045+
}
1046+
10401047
Projection::Projection(const Transform3D &p_transform) {
10411048
const Transform3D &tr = p_transform;
10421049
real_t *m = &columns[0][0];

0 commit comments

Comments
 (0)