相关文章推荐
玩足球的拐杖  ·  python - TypeError: ...·  1 年前    · 
长情的风衣  ·  “干掉” Date,Java8 ...·  2 年前    · 
爱笑的肉夹馍  ·  javascript ...·  2 年前    · 
英勇无比的松树  ·  C/C++ - ...·  2 年前    · 


osg控制相机移动

viewer->getCameraManipulator()->setHomePosition(_homeEye,_homeCenter,_homeUp);



osg::Vec3d              _homeEye;
osg::Vec3d _homeCenter;
osg::Vec3d _homeUp;

/** Manually set the home position, and set the automatic compute of home position. */
virtual void setHomePosition(const osg::Vec3d& eye, const osg::Vec3d& center, const osg::Vec3d& up, bool autoComputeHomePosition=false)
{
setAutoComputeHomePosition(autoComputeHomePosition);
_homeEye = eye;
_homeCenter = center;
_homeUp = up;
}

/** Get the manually set home position. */
virtual void getHomePosition(osg::Vec3d& eye, osg::Vec3d& center, osg::Vec3d& up) const
{
eye = _homeEye;
center = _homeCenter;
up = _homeUp;
}


##############################