当前位置: 首页>>代码示例>>C++>>正文


C++ Rotation::convertRotationToBodyFixedXYZ方法代码示例

本文整理汇总了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]);
    }
}
开发者ID:cpizzolato,项目名称:opensim-core,代码行数:16,代码来源:EllipsoidJoint.cpp

示例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]);
    }
}
开发者ID:wagglefoot,项目名称:opensim-core,代码行数:18,代码来源:GimbalJoint.cpp

示例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]);
    }
}
开发者ID:antoinefalisse,项目名称:opensim-core,代码行数:20,代码来源:FreeJoint.cpp

示例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]);
    }
}
开发者ID:ANKELA,项目名称:opensim-core,代码行数:24,代码来源:FreeJoint.cpp


注:本文中的Rotation::convertRotationToBodyFixedXYZ方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。