osgGA的CameraManipulator类
来源:互联网 发布:看电视台直播的软件 编辑:程序博客网 时间:2024/06/05 20:51
操作器基类,用于实现各种操作器接口。本身也是一个操作器的管理类,里面可以压入多个操作器,根据用户按键选择使用哪一个操作器。
virtual const char * className() const
说明:获取当前类的名称
void addMatrixManipulator(int key , std::string nam , CameraManipulator *cm)
说明:添加一个操作器,附带名称以及响应的键,当按下响应键时,视口将自动切换到该操作器。
key 响应键的ASCII码
name 操作器的名称
cm 实际要切换的操作器
void addNumberedMatrixManipulator(CameraManipulator *cm)
说明:添加一个由数字键控制的操作器
cm 由数字控制的实际要添加的操作器
unsigned int getNumberMatrixManipulators() const
说明:得到当前已经添加了多少个操作器,这里是指操作器管理类型,例如使用addNumberedMatrixManipulator添加了10个操作器,这里直接返回10
void selectMatrixManipulator(unsigned int num)
说明:选择第几个操作器,这个和用户压入操作器的顺序是强相关的
num 操作器的编号
KeyManipMap &getKeyManipMap()
const KeyManipMap &getKeyManipMap() const
说明:返回键盘响应与操作器的对应表
CameraManipulator *getCurrentMatrixManipulator()
const CameraManipulator *getCurrentMatrixManipulator() const
说明:得到当前正在运行的操作器
CameraManipulator *getMatrixManipulatorWithIndex(unsigned int key)
const CameraManipulator *getMatrixManipulatorWithIndex(unsigned int key) const
CameraManipulator *getMatrixManipulatorWithKey(unsigned int key)
const CameraManipulator *getMatrixManipulatorWithKey(unsigned int key) const
说明:按输入的编号得到操作器
key 操作器的编号
virtual void setCoordinateFrameCallback(CoordinateFrameCallback * cb)
说明:设置坐标系统的回调,回来告诉操作器自己设置的坐标系统
virtual void setByMatrix(const osg::Matrixd &matrix)
说明:直接通过设置视口矩阵的方法来改变当前场景的位置和方向
matrix 视口矩阵
virtual void setByInverseMatrix(const osg::Matrixd &matrix)
说明:直接通过设置视口逆矩阵的方法来改变当前场景的位置和朝向
matrix 视口逆矩阵
virtual osg::Matrixd getMatrix() const
说明:得到当前的视口矩阵。由于外部接口调用来绘制当前场景,该函数必须实现才能实现自己的操作器。
virtual osg::Matrixd getInverseMatrix() const
说明:得到当前视口的逆矩阵。自定义操作器必须实现的函数
virtual osgUtil::SceneView::FusionDistanceMode getFusionDistanceMode() const
说明:得到融合距离的计算模式
virutal float getFusionDistanceValue() const
说明:得到融合距离
virtual void setNode(osg::Node *n)
说明:绑定一个节点到操作器,并解除其他绑定。此功能因派生类的实现不同而不同
n 需要绑定的节点
virtual const osg::Node *getNode() const
virtual osg::Node *getNode()
说明:得到已经绑定的节点
virtual void setHomePosition(const osg::Vec3d &eye , const osg::Vec3d ¢er , const osg::Vec3d &up , bool autoComputeHomePosition = false)
说明:设置出生点
eye 视点位置
center 视点水平朝向
up 视点垂直朝向
autoComputeHomePosition 是否自动计算出生点。如果自动计算它将会根据场景的大小,选择一个合适的点位,就像在TrackBall里按空格键
virtual void setAutoComputeHomePosition(bool flag)
说明:设置是否自动计算出生点位
flag 自动计算出生点位
virtual void computeHomePosition()
说明:计算出生点位
virtual void home(const GUIEventAdapter &ee , GUIActionAdapter &aa)
说明:将相机移动到出生点
ee 事件传递参数
aa 事件传递参数
virtual void init(const GUIEventAdapter &ee , GUIActionAdapter &aa)
说明:重启/重设操作器
virtual bool handle(const GUIEventAdapter &ee , GUIActionAdapter &aa)
说明:操作器的事件处理函数
- osgGA的CameraManipulator类
- osg中漫游器的原理——osgGA::CameraManipulator(二)
- osg中漫游器的原理(二)——osgGA::CameraManipulator
- osg中漫游器的原理——osgGA::CameraManipulator(二)
- osgGA::AnimationPathManipulator的使用(实现固定路径漫游)
- osgGA::AnimationPathManipulator动画触发时间异常的解决方法
- OSG学习之示例遇到的问题三无法打开文件osgGA/MatrixManipulator错误
- OSG学习之示例遇到的问题三无法打开文件osgGA/MatrixManipulator错误
- 1、osgViewer::Viewer,osgViewer::ViewerBase,osgGA::KeySwitchMatrixManipulator,osg::ArgumentParser的说明
- osgGA::GUIEventAdapter解析
- 9、osgGA::GUIEventHandler,osgFX::Scribe
- error C2039: 'addCameraManipulator' : is not a member of 'osgGA
- osgGA::KeySwitchMatrixManipulator按键选择切换操作器使用
- OSG中项目生成无法打开包括文件:“osgGA/MatrixManipulator”
- Osg/OsgEarth—— 无法打开文件osgGA/MatrixManipulator错误
- 1>LINK : fatal error LNK1181: 无法打开输入文件“osgGA.lib”
- 类的成员的类的初始化
- 类的
- 仿小米、华为、滴答清单、365、钉钉自定义日历
- Android自学之旅--按钮的各个点击事件
- 依旧是回溯法,还有深搜妙用极其深入理解
- 为一个驱动添加Android中间层的步骤
- 树莓派上手
- osgGA的CameraManipulator类
- 数字证书和golang的研究
- 如何使用Java来编译运行C文件(一)
- 写一个图案解锁控件
- B. Reading codeforces-problem-234B
- AnimationPath类
- 一天一个控件——TextInputLayout
- 可变参数
- Docker实践 - 使用maven插件自动部署web应用至Docker容器的tomcat