Skip to content

Commit 0c221f0

Browse files
authored
Merge pull request #65124 from zhehangd/fix_basis
2 parents 73021d4 + 69fe633 commit 0c221f0

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

core/math/basis.h

+2-4
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,8 @@ struct _NO_DISCARD_ Basis {
238238
Basis(const Vector3 &p_axis, real_t p_angle, const Vector3 &p_scale) { set_axis_angle_scale(p_axis, p_angle, p_scale); }
239239
static Basis from_scale(const Vector3 &p_scale);
240240

241-
_FORCE_INLINE_ Basis(const Vector3 &row0, const Vector3 &row1, const Vector3 &row2) {
242-
rows[0] = row0;
243-
rows[1] = row1;
244-
rows[2] = row2;
241+
_FORCE_INLINE_ Basis(const Vector3 &p_x_axis, const Vector3 &p_y_axis, const Vector3 &p_z_axis) {
242+
set_columns(p_x_axis, p_y_axis, p_z_axis);
245243
}
246244

247245
_FORCE_INLINE_ Basis() {}

core/math/vector3.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ Vector3 Vector3::octahedron_tangent_decode(const Vector2 &p_oct, float *sign) {
134134
}
135135

136136
Basis Vector3::outer(const Vector3 &p_with) const {
137-
Vector3 row0(x * p_with.x, x * p_with.y, x * p_with.z);
138-
Vector3 row1(y * p_with.x, y * p_with.y, y * p_with.z);
139-
Vector3 row2(z * p_with.x, z * p_with.y, z * p_with.z);
140-
141-
return Basis(row0, row1, row2);
137+
Basis basis;
138+
basis.rows[0] = Vector3(x * p_with.x, x * p_with.y, x * p_with.z);
139+
basis.rows[1] = Vector3(y * p_with.x, y * p_with.y, y * p_with.z);
140+
basis.rows[2] = Vector3(z * p_with.x, z * p_with.y, z * p_with.z);
141+
return basis;
142142
}
143143

144144
bool Vector3::is_equal_approx(const Vector3 &p_v) const {

editor/plugins/skeleton_3d_editor_plugin.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,9 @@ PhysicalBone3D *Skeleton3DEditor::create_physical_bone(int bone_id, int bone_chi
426426
bone_shape->set_name("CollisionShape3D");
427427

428428
Transform3D capsule_transform;
429-
capsule_transform.basis = Basis(Vector3(1, 0, 0), Vector3(0, 0, 1), Vector3(0, -1, 0));
429+
capsule_transform.basis.rows[0] = Vector3(1, 0, 0);
430+
capsule_transform.basis.rows[1] = Vector3(0, 0, 1);
431+
capsule_transform.basis.rows[2] = Vector3(0, -1, 0);
430432
bone_shape->set_transform(capsule_transform);
431433

432434
/// Get an up vector not collinear with child rest origin

0 commit comments

Comments
 (0)