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;
68 Vector3d& getRotationRate() {
return angvel_; }
86 Vector3d& getVelocity() {
return velocity_; }
126 void setIdentity() { Transform::setIdentity(); angvel_ = Vector3d::Zero(); velocity_ = Vector3d::Zero(); }
133 void transformPositionVelocity(
const Vector3d& position,
const Vector3d& velocity, Vector3d& positionOut, Vector3d& velocityOut);
142 const KinematicRotation& kinematicRotation()
const {
return reinterpret_cast<const KinematicRotation&
>(rotation_); }
155 *
this = this->composed(next);
167 Vector3d translation = this->getTranslation() + vector;
168 Vector3d velocity = this->getVelocity() + next.
getVelocity() * this->getMatrix()
169 + this->getRotationRate().cross(vector);
175 return composed(next);
180 return compose(next);
186 this->getInverse(retval);
192 this->getKinematicRotation().transformVectorVelocity(-this->getTranslation(), -this->getVelocity(), inversed.
getTranslation(), inversed.
getVelocity());
196A_ALWAYS_INLINE
void KinematicTransform::transformPositionVelocity(
const Vector3d &position,
const Vector3d &velocity, Vector3d &positionOut, Vector3d &velocityOut)
200 Vector3d relPos = position - this->getTranslation();
202 this->getRotation().transformVector(relPos, positionOut);
204 Vector3d velDiff = velocity - this->getVelocity() - this->getRotationRate().cross(relPos);
206 this->getRotation().transformVector(velDiff, velocityOut);
211 this->getKinematicRotation().transformVectorVelocity(
212 position - this->getTranslation(),
213 velocity - this->getVelocity(),
223 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:151