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


C++ Visualizer::getSystemUpDirection方法代码示例

本文整理汇总了C++中Visualizer::getSystemUpDirection方法的典型用法代码示例。如果您正苦于以下问题:C++ Visualizer::getSystemUpDirection方法的具体用法?C++ Visualizer::getSystemUpDirection怎么用?C++ Visualizer::getSystemUpDirection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Visualizer的用法示例。


在下文中一共展示了Visualizer::getSystemUpDirection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: offset

void Visualizer::BodyFollower::generateControls(
        const Visualizer&             viz,
        const State&                  state,
        Array_< DecorativeGeometry >& geometry)
{
    // Offset.
    Vec3 offset(m_offset);
    if (m_offset.isNaN()) {
        // Default: offset is based on system up direction and ground height.
        offset = Vec3(1, 1, 1);
        offset[viz.getSystemUpDirection().getAxis()] += viz.getGroundHeight();
    }

    // Up direction. Default: use System up direction.
    const UnitVec3& upDirection = m_upDirection.isNaN() ?
        UnitVec3(viz.getSystemUpDirection()) : m_upDirection;

    const Vec3 P = m_mobodB.findStationLocationInGround(state, m_stationPinB);
    // Position of camera (C) from ground origin (G), expressed in ground.
    const Vec3 p_GC = P + offset;
    // Rotation of camera frame (C) in ground frame (G).
    // To get the camera to point at P, we require the camera's z direction
    // (which points "back") to be parallel to the offset. We also want the
    // camera's y direction (which points to the top of the screen) to be as
    // closely aligned with the provided up direction as is possible.
    const Rotation R_GC(UnitVec3(offset), ZAxis, upDirection, YAxis);
    viz.setCameraTransform(Transform(R_GC, p_GC));
}
开发者ID:thomasklau,项目名称:simbody,代码行数:28,代码来源:Visualizer.cpp


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