25#include "AstMath/KinematicRotation.hpp"
26#include "AstCore/OrbitElement.hpp"
42 :
Transform(translate.pos(), rot.getRotation())
43 , angvel_(rot.getRotationRate())
44 , velocity_(translate.vel())
49 :
Transform(translation, rot.getRotation())
50 , angvel_(rot.getRotationRate())
56 static KinematicTransform Identity();
58 using Transform::getTranslation;
59 using Transform::setTranslation;
60 using Transform::transformPosition;
61 using Transform::getRotation;
70 Vector3d& getRotationRate() {
return angvel_; }
88 Vector3d& getVelocity() {
return velocity_; }
128 void setIdentity() { Transform::setIdentity(); angvel_ = Vector3d::Zero(); velocity_ = Vector3d::Zero(); }
135 void transformPositionVelocity(
const Vector3d& position,
const Vector3d& velocity, Vector3d& positionOut, Vector3d& velocityOut);
144 const KinematicRotation& kinematicRotation()
const {
return reinterpret_cast<const KinematicRotation&
>(rotation_); }
157 *
this = this->composed(next);
169 Vector3d translation = this->getTranslation() + vector;
170 Vector3d velocity = this->getVelocity() + next.
getVelocity() * this->getMatrix()
171 + this->getRotationRate().cross(vector);
177 return composed(next);
182 return compose(next);
188 this->getInverse(retval);
194 this->getKinematicRotation().transformVectorVelocity(-this->getTranslation(), -this->getVelocity(), inversed.
getTranslation(), inversed.
getVelocity());
198A_ALWAYS_INLINE
void KinematicTransform::transformPositionVelocity(
const Vector3d &position,
const Vector3d &velocity, Vector3d &positionOut, Vector3d &velocityOut)
202 Vector3d relPos = position - this->getTranslation();
204 this->getRotation().transformVector(relPos, positionOut);
206 Vector3d velDiff = velocity - this->getVelocity() - this->getRotationRate().cross(relPos);
208 this->getRotation().transformVector(velDiff, velocityOut);
213 this->getKinematicRotation().transformVectorVelocity(
214 position - this->getTranslation(),
215 velocity - this->getVelocity(),
225 this->transformPositionVelocity(state.
pos(), state.
vel(), stateOut.
pos(), stateOut.
vel());
直角坐标
定义 OrbitElement.hpp:46
const Vector3d & pos() const
获取位置
定义 OrbitElement.hpp:59
const Vector3d & vel() const
获取速度
定义 OrbitElement.hpp:64
运动学坐标系旋转
定义 KinematicRotation.hpp:32
KinematicRotation composed(const KinematicRotation &next) const
组合下一个旋转
定义 KinematicRotation.hpp:152