Browse Source

Math: added zero() and identity() methods to Matrix3f

mission-4.1.18
Andrew Tridgell 13 years ago
parent
commit
31e566475b
  1. 15
      libraries/AP_Math/matrix3.h

15
libraries/AP_Math/matrix3.h

@ -124,6 +124,21 @@ public: @@ -124,6 +124,21 @@ public:
Matrix3<T> transpose(void)
{ return *this = transposed(); }
// zero the matrix
void zero(void) {
a.x = a.y = a.z = 0;
b.x = b.y = b.z = 0;
c.x = c.y = c.z = 0;
}
// setup the identity matrix
void identity(void) {
a.x = b.y = c.z = 1;
a.y = a.z = 0;
b.x = b.z = 0;
c.x = c.y = 0;
}
// check if any elements are NAN
bool is_nan(void)
{ return a.is_nan() || b.is_nan() || c.is_nan(); }

Loading…
Cancel
Save