forked from Archive/PX4-Autopilot
AxisAngle use Vector3<T> instead of Vector<T, 3>
This commit is contained in:
parent
ea4fdfd637
commit
44a8c553fb
|
@ -24,7 +24,7 @@ class Quaternion;
|
|||
* described by this class.
|
||||
*/
|
||||
template<typename Type>
|
||||
class AxisAngle : public Vector<Type, 3>
|
||||
class AxisAngle : public Vector3<Type>
|
||||
{
|
||||
public:
|
||||
using Matrix31 = Matrix<Type, 3, 1>;
|
||||
|
@ -35,7 +35,7 @@ public:
|
|||
* @param data_ array
|
||||
*/
|
||||
explicit AxisAngle(const Type data_[3]) :
|
||||
Vector<Type, 3>(data_)
|
||||
Vector3<Type>(data_)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ public:
|
|||
* @param other Matrix31 to copy
|
||||
*/
|
||||
AxisAngle(const Matrix31 &other) :
|
||||
Vector<Type, 3>(other)
|
||||
Vector3<Type>(other)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ public:
|
|||
{
|
||||
AxisAngle &v = *this;
|
||||
// make sure axis is a unit vector
|
||||
Vector<Type, 3> a = axis_;
|
||||
Vector3<Type> a = axis_;
|
||||
a = a.unit();
|
||||
v(0) = a(0) * angle_;
|
||||
v(1) = a(1) * angle_;
|
||||
|
@ -138,10 +138,10 @@ public:
|
|||
}
|
||||
|
||||
|
||||
Vector<Type, 3> axis()
|
||||
Vector3<Type> axis()
|
||||
{
|
||||
if (Vector<Type, 3>::norm() > 0) {
|
||||
return Vector<Type, 3>::unit();
|
||||
if (Vector3<Type>::norm() > 0) {
|
||||
return Vector3<Type>::unit();
|
||||
|
||||
} else {
|
||||
return Vector3<Type>(1, 0, 0);
|
||||
|
@ -150,7 +150,7 @@ public:
|
|||
|
||||
Type angle()
|
||||
{
|
||||
return Vector<Type, 3>::norm();
|
||||
return Vector3<Type>::norm();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue