本文整理汇总了C++中Rotation::convertRotationToBodyFixedXYZ方法的典型用法代码示例。如果您正苦于以下问题:C++ Rotation::convertRotationToBodyFixedXYZ方法的具体用法?C++ Rotation::convertRotationToBodyFixedXYZ怎么用?C++ Rotation::convertRotationToBodyFixedXYZ使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rotation
的用法示例。
在下文中一共展示了Rotation::convertRotationToBodyFixedXYZ方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: extendSetPropertiesFromState
void EllipsoidJoint::extendSetPropertiesFromState(const SimTK::State& state)
{
Super::extendSetPropertiesFromState(state);
// Override default in case of quaternions.
const SimbodyMatterSubsystem& matter = getModel().getMatterSubsystem();
if (!matter.getUseEulerAngles(state)) {
Rotation r = getChildFrame().getMobilizedBody().getBodyRotation(state);
Vec3 angles = r.convertRotationToBodyFixedXYZ();
updCoordinate(EllipsoidJoint::Coord::Rotation1X).setDefaultValue(angles[0]);
updCoordinate(EllipsoidJoint::Coord::Rotation2Y).setDefaultValue(angles[1]);
updCoordinate(EllipsoidJoint::Coord::Rotation3Z).setDefaultValue(angles[2]);
}
}
示例2: extendSetPropertiesFromState
void GimbalJoint::extendSetPropertiesFromState(const SimTK::State& state)
{
Super::extendSetPropertiesFromState(state);
// Override default behavior in case of quaternions.
const MultibodySystem& system = _model->getMultibodySystem();
const SimbodyMatterSubsystem& matter = system.getMatterSubsystem();
if (!matter.getUseEulerAngles(state)) {
Rotation r = getChildFrame().getMobilizedBody().getBodyRotation(state);
Vec3 angles = r.convertRotationToBodyFixedXYZ();
const CoordinateSet& coordinateSet = get_CoordinateSet();
coordinateSet[0].setDefaultValue(angles[0]);
coordinateSet[1].setDefaultValue(angles[1]);
coordinateSet[2].setDefaultValue(angles[2]);
}
}
示例3: extendSetPropertiesFromState
void FreeJoint::extendSetPropertiesFromState(const SimTK::State& state)
{
Super::extendSetPropertiesFromState(state);
// Override default behavior in case of quaternions.
const MultibodySystem& system = _model->getMultibodySystem();
const SimbodyMatterSubsystem& matter = system.getMatterSubsystem();
if (!matter.getUseEulerAngles(state)) {
Rotation r = getChildFrame().getMobilizedBody().getMobilizerTransform(state).R();
Vec3 t = getChildFrame().getMobilizedBody().getMobilizerTransform(state).p();
Vec3 angles = r.convertRotationToBodyFixedXYZ();
updCoordinate(FreeJoint::Coord::Rotation1X).setDefaultValue(angles[0]);
updCoordinate(FreeJoint::Coord::Rotation2Y).setDefaultValue(angles[1]);
updCoordinate(FreeJoint::Coord::Rotation3Z).setDefaultValue(angles[2]);
updCoordinate(FreeJoint::Coord::TranslationX).setDefaultValue(t[0]);
updCoordinate(FreeJoint::Coord::TranslationY).setDefaultValue(t[1]);
updCoordinate(FreeJoint::Coord::TranslationZ).setDefaultValue(t[2]);
}
}
示例4: extendSetPropertiesFromState
void FreeJoint::extendSetPropertiesFromState(const SimTK::State& state)
{
Super::extendSetPropertiesFromState(state);
// Override default behavior in case of quaternions.
const MultibodySystem& system = _model->getMultibodySystem();
const SimbodyMatterSubsystem& matter = system.getMatterSubsystem();
if (!matter.getUseEulerAngles(state)) {
Rotation r = getChildFrame().getMobilizedBody().getMobilizerTransform(state).R();
Vec3 t = getChildFrame().getMobilizedBody().getMobilizerTransform(state).p();
Vec3 angles = r.convertRotationToBodyFixedXYZ();
int zero = 0; // Workaround for really ridiculous Visual Studio 8 bug.
const CoordinateSet& coordinateSet = get_CoordinateSet();
coordinateSet.get(zero).setDefaultValue(angles[0]);
coordinateSet.get(1).setDefaultValue(angles[1]);
coordinateSet.get(2).setDefaultValue(angles[2]);
coordinateSet.get(3).setDefaultValue(t[0]);
coordinateSet.get(4).setDefaultValue(t[1]);
coordinateSet.get(5).setDefaultValue(t[2]);
}
}