summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-09-08 15:03:58 +0200
committerGitHub <noreply@github.com>2020-09-08 15:03:58 +0200
commitd425cf58e4e300f2258d791b528c679e55c1bc34 (patch)
tree79bf233a3743dcc129b1913c07c3f47c0b0a26d5
parent1e1a9be93ed382ee61fc5af7eca5442e60763bbc (diff)
parent9149fb760ce6e85af640ce38a302255e4ea8b81a (diff)
Merge pull request #41879 from madmiraal/fix-40505
Initialise Basis elements with a default Basis in the declaration.
-rw-r--r--core/math/basis.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/core/math/basis.h b/core/math/basis.h
index 985fb0e44f..a86937ceb4 100644
--- a/core/math/basis.h
+++ b/core/math/basis.h
@@ -36,7 +36,11 @@
class Basis {
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 {
return elements[axis];
@@ -254,17 +258,7 @@ public:
elements[2] = row2;
}
- _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_ Basis() {}
};
_FORCE_INLINE_ void Basis::operator*=(const Basis &p_matrix) {