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


C++ Vec3d::set方法代码示例

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


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

示例1: getGeographicSRS

bool 
SpatialReference::transformFromECEF(const osg::Vec3d& input,
                                    osg::Vec3d&       output ) const
{
    // transform to lat/long:
    osg::Vec3d geo;

    getGeographicSRS()->getEllipsoid()->convertXYZToLatLongHeight(
        input.x(), input.y(), input.z(),
        geo.y(), geo.x(), geo.z() );

    // then convert to the local SRS.
    if ( isGeographic() )
    {
        output.set( osg::RadiansToDegrees(geo.x()), osg::RadiansToDegrees(geo.y()), geo.z() );
    }
    else
    {
        getGeographicSRS()->transform( 
            osg::RadiansToDegrees(geo.x()), osg::RadiansToDegrees(geo.y()), geo.z(),
            this,
            output.x(), output.y(), output.z() );
        //output.z() = geo.z();
    }

    return true;
}
开发者ID:spencerg,项目名称:osgearth,代码行数:27,代码来源:SpatialReference.cpp

示例2: vehiclePoseCallback

void vehiclePoseCallback(const nav_msgs::Odometry& odom) {
	if (!firstpass) {
		initialT.set(odom.pose.pose.position.x,odom.pose.pose.position.y,odom.pose.pose.position.z);
		initialQ.set(odom.pose.pose.orientation.x, odom.pose.pose.orientation.y, odom.pose.pose.orientation.z, odom.pose.pose.orientation.w);
		wMv_initial.setTrans(initialT);
		wMv_initial.setRotate(initialQ);
		firstpass=true;
	} 
}
开发者ID:perezsolerj,项目名称:underwater_simulation,代码行数:9,代码来源:setVehicleDisturbances.cpp

示例3: transform

bool FrameManager::transform(const std::string& frame, ros::Time time, const geometry_msgs::Pose& pose_msg, osg::Vec3d& position, osg::Quat& orientation)
{
    position.set(0,0,0);
    orientation.set(0,0,0,1);

    // put all pose data into a tf stamped pose
    btQuaternion bt_orientation(pose_msg.orientation.x, pose_msg.orientation.y, pose_msg.orientation.z, pose_msg.orientation.w);
    btVector3 bt_position(pose_msg.position.x, pose_msg.position.y, pose_msg.position.z);

    if (bt_orientation.x() == 0.0 && bt_orientation.y() == 0.0 && bt_orientation.z() == 0.0 && bt_orientation.w() == 0.0)
    {
        bt_orientation.setW(1.0);
    }

    tf::Stamped<tf::Pose> pose_in(btTransform(bt_orientation,bt_position), time, frame);
    tf::Stamped<tf::Pose> pose_out;

    // convert pose into new frame
    try
    {
        tf_->transformPose( fixed_frame_, pose_in, pose_out );
    }
    catch(tf::TransformException& e)
    {
        ROS_DEBUG("Error transforming from frame '%s' to frame '%s': %s", frame.c_str(), fixed_frame_.c_str(), e.what());
        return false;
    }

#if ROS_VERSION_MINIMUM(1, 8, 0)
    //ROS Fuerte version
    bt_position = pose_out.asBt().getOrigin();
    bt_orientation = pose_out.asBt().getRotation();
#else
    bt_position = pose_out.getOrigin();
    bt_orientation = pose_out.getRotation();
#endif
    position = osg::Vec3d(bt_position.x(), bt_position.y(), bt_position.z());
    orientation = osg::Quat( bt_orientation.x(), bt_orientation.y(), bt_orientation.z(), bt_orientation.w() );

    return true;
}
开发者ID:zhsaymj,项目名称:visualization_osg,代码行数:41,代码来源:frame_manager.cpp

示例4: getTransformation

// doc in parent
void OrbitCameraManipulator::getTransformation( osg::Vec3d& eye, osg::Vec3d& center, osg::Vec3d& up ) const
{
	center.set( m_lookat );
	eye.set( m_eye );
	up.set( m_up );
}
开发者ID:Supporting,项目名称:ifcplusplus,代码行数:7,代码来源:OrbitCameraManipulator.cpp

示例5: getCurrentPositionAsLookAt

void UFOManipulator::getCurrentPositionAsLookAt( osg::Vec3d& eye, osg::Vec3d& center, osg::Vec3d& up )
{
    eye = _position;
    center = _position + _direction;
    up.set(getUpVector(getCoordinateFrame(_position)));
}
开发者ID:aalex,项目名称:osg,代码行数:6,代码来源:UFOManipulator.cpp


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