24#include "AstMath/Quaternion.hpp"
25#include "AstMath/Matrix.hpp"
26#include "AstMath/Vector.hpp"
27#include "AstMath/AngleAxis.hpp"
28#include "AstMath/AttitudeConvert.hpp"
34#define _AST_DEF_ROTATION_PROPERTIES\
35 const Rotation& rotation() const { return rotation_; }\
36 Rotation& rotation() { return rotation_; }\
37 const Rotation& getRotation() const { return rotation_; }\
38 Rotation& getRotation() { return rotation_; }\
39 void setRotation(const Rotation& rotation) { rotation_ = rotation; }\
40 const Matrix3d& matrix() const { return rotation_.matrix(); }\
41 Matrix3d& matrix() { return rotation_.matrix(); }\
42 const Matrix3d& getMatrix() const { return rotation_.matrix(); }\
43 Matrix3d& getMatrix() { return rotation_.matrix(); }\
44 void setMatrix(const Matrix3d& mat) { rotation_.setMatrix(mat); }\
45 Quaternion quaternion() const { return rotation_.getQuaternion(); }\
46 Quaternion getQuaternion() const { return rotation_.getQuaternion(); }\
65 return *
reinterpret_cast<Rotation*
>(&mat);
71 return *
reinterpret_cast<const Rotation*
>(&mat);
98 Rotation(
double angle,
const Vector3d& axis);
108 Matrix3d& getMatrix() {
return matrix_; }
109 const Matrix3d& matrix()
const {
return matrix_; }
110 Matrix3d& matrix() {
return matrix_; }
126 Vector3d getAxis()
const;
130 double getAngle()
const;
136 void getAngleAxis(
double& angle, Vector3d& axis)
const;
142 void setAngleAxis(
double angle,
const Vector3d& axis);
179 void getInverse(
Rotation& inversed)
const;
188 void transformVector(
const Vector3d& vector, Vector3d& vectorOut)
const;
195 void transformVectorInv(
const Vector3d& vector, Vector3d& vectorOut)
const;
200 Vector3d transformVector(
const Vector3d& vector)
const;
206 Vector3d transformVectorInv(
const Vector3d& vector)
const;
220A_ALWAYS_INLINE Rotation::Rotation(
const Matrix3d& mat)
231 : matrix_(aa.toRotationMatrix())
237 return Rotation(Matrix3d::Identity());
289 matrix_ = next.matrix_ * matrix_;
295 return Rotation(next.matrix_ * matrix_);
310 inversed.matrix_ = this->matrix_.transpose();
322 vectorOut = this->matrix_ * vector;
327 vectorOut = vector * this->matrix_;
const Vector3d & axis() const
获取旋转轴
定义 AngleAxis.hpp:53
double angle() const
获取旋转角度(弧度)
定义 AngleAxis.hpp:48
Matrix3d toRotationMatrix() const
轴角转旋转矩阵
定义 AngleAxis.hpp:74
double getAngle() const
获取旋转角度(弧度)
定义 Rotation.hpp:257
Vector3d getAxis() const
获取旋转轴
定义 Rotation.hpp:250
void transformVector(const Vector3d &vector, Vector3d &vectorOut) const
变换向量
定义 Rotation.hpp:320
void transformVectorInv(const Vector3d &vector, Vector3d &vectorOut) const
变换向量(逆变换)
定义 Rotation.hpp:325
void getAngleAxis(double &angle, Vector3d &axis) const
获取旋转轴和角度(弧度)
定义 Rotation.hpp:264
void getInverse(Rotation &inversed) const
获取逆旋转
定义 Rotation.hpp:308
static Rotation FromMatrix(const Matrix3d &mat)
从矩阵转换为坐标系旋转对象
定义 Rotation.hpp:75
Rotation & compose(const Rotation &next)
组合下一个旋转
定义 Rotation.hpp:287
static const Rotation & CastFrom(const Matrix3d &mat)
从矩阵转换为坐标系旋转对象(常量版本)
定义 Rotation.hpp:69
Rotation()=default
坐标系旋转类默认构造函数
static Rotation Identity()
单位旋转
定义 Rotation.hpp:235
void setQuaternion(const Quaternion &quat)
设置四元数
定义 Rotation.hpp:245
const Matrix3d & getMatrix() const
获取旋转矩阵
定义 Rotation.hpp:107
Quaternion getQuaternion() const
获取四元数
定义 Rotation.hpp:240
Rotation composed(const Rotation &next) const
组合下一个旋转
定义 Rotation.hpp:293
void setMatrix(const Matrix3d &mat)
设置旋转矩阵
定义 Rotation.hpp:114
Rotation operator*(const Rotation &next) const
组合下一个旋转
定义 Rotation.hpp:298
void setAngleAxis(double angle, const Vector3d &axis)
设置轴角
定义 Rotation.hpp:272
Rotation(const Rotation &other)=default
复制构造函数
static Rotation & CastFrom(Matrix3d &mat)
从矩阵转换为坐标系旋转对象
定义 Rotation.hpp:63
Rotation inverse() const
获取逆旋转
定义 Rotation.hpp:313
Rotation & operator*=(const Rotation &next)
组合下一个旋转
定义 Rotation.hpp:303
void aQuatToMatrix(const Quaternion &quat, Matrix3d &m)
四元数转矩阵
定义 AttitudeConvert.cpp:90
void aMatrixToAngleAxis(const Matrix3d &mtx, AngleAxis &aa)
矩阵转轴角
定义 AttitudeConvert.cpp:788
void aMatrixToQuat(const Matrix3d &mtx, Quaternion &quat)
矩阵转四元数
定义 AttitudeConvert.cpp:115