mirror of
https://github.com/godotengine/godot
synced 2024-09-05 21:39:38 +00:00
Merge pull request #41879 from madmiraal/fix-40505
Initialise Basis elements with a default Basis in the declaration.
This commit is contained in:
commit
d425cf58e4
|
@ -36,7 +36,11 @@
|
||||||
|
|
||||||
class Basis {
|
class Basis {
|
||||||
public:
|
public:
|
||||||
Vector3 elements[3];
|
Vector3 elements[3] = {
|
||||||
|
Vector3(1, 0, 0),
|
||||||
|
Vector3(0, 1, 0),
|
||||||
|
Vector3(0, 0, 1)
|
||||||
|
};
|
||||||
|
|
||||||
_FORCE_INLINE_ const Vector3 &operator[](int axis) const {
|
_FORCE_INLINE_ const Vector3 &operator[](int axis) const {
|
||||||
return elements[axis];
|
return elements[axis];
|
||||||
|
@ -254,17 +258,7 @@ public:
|
||||||
elements[2] = row2;
|
elements[2] = row2;
|
||||||
}
|
}
|
||||||
|
|
||||||
_FORCE_INLINE_ Basis() {
|
_FORCE_INLINE_ Basis() {}
|
||||||
elements[0][0] = 1;
|
|
||||||
elements[0][1] = 0;
|
|
||||||
elements[0][2] = 0;
|
|
||||||
elements[1][0] = 0;
|
|
||||||
elements[1][1] = 1;
|
|
||||||
elements[1][2] = 0;
|
|
||||||
elements[2][0] = 0;
|
|
||||||
elements[2][1] = 0;
|
|
||||||
elements[2][2] = 1;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
_FORCE_INLINE_ void Basis::operator*=(const Basis &p_matrix) {
|
_FORCE_INLINE_ void Basis::operator*=(const Basis &p_matrix) {
|
||||||
|
|
Loading…
Reference in a new issue