From b3e1b6c57d5436b7499e1f1f132a4ccd15cdfe14 Mon Sep 17 00:00:00 2001 From: "rmackay9@yahoo.com" Date: Thu, 23 Sep 2010 03:14:15 +0000 Subject: [PATCH] minor corrections to the operator *= and constructor so that matrix can be more easily created from vector objects git-svn-id: https://arducopter.googlecode.com/svn/trunk@540 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- libraries/AP_Math/matrix3.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/AP_Math/matrix3.h b/libraries/AP_Math/matrix3.h index 9c8ce6cb65..4e767103c1 100644 --- a/libraries/AP_Math/matrix3.h +++ b/libraries/AP_Math/matrix3.h @@ -78,11 +78,11 @@ public: // uniform scaling Matrix3 operator * (const T num) const { return Matrix3(a*num, b*num, c*num); } - Matrix3 operator *= (const T num) + Matrix3 &operator *= (const T num) { return *this = *this * num; } Matrix3 operator / (const T num) const { return Matrix3(a/num, b/num, c/num); } - Matrix3 operator /= (const T num) + Matrix3 &operator /= (const T num) { return *this = *this / num; } // multiplication by a vector @@ -107,8 +107,8 @@ public: c.x * m.a.z + c.y * m.b.z + c.z * m.c.z)); return temp; } - Matrix3 operator *=(const Matrix3 &m) - { return *this = this * m; } + Matrix3 &operator *=(const Matrix3 &m) + { return *this = *this * m; } // transpose the matrix Matrix3 transposed(void) @@ -126,7 +126,7 @@ public: /* trivial ctor */ \ name() {} \ /* make a,b,c combination into a matrix */ \ - name(Vector3 &a0, Vector3 &b0, Vector3 &c0) : Matrix3(a0, b0, c0) {} + name(const Vector3 &a0, const Vector3 &b0, const Vector3 &c0) : Matrix3(a0, b0, c0) {} class Matrix3i : public Matrix3 {