|
本帖最后由 osgxch 于 2015-1-26 14:55 编辑
我的意愿是:当视点发生变化的时候,再执行自定义处理
class MyCameraPostDrawCallback : public osg::Camera:rawCallback
{
public:
MyCameraPostDrawCallback(osg::Image* depth, osg::Image* color,osgViewer::Viewer* viewer) :
_depth(depth),
_color(color),
_viewer(viewer)
{
}
virtual void operator () (const osg::Camera & cam) const
{
_viewer->getCamera()->getViewMatrixAsLookAt(_eye_new, _center_new, _up_new);
if(isViewMatrixAsLookAtChange(eye_new, center_new,eye_old, center_old);)
{
//
do something when ViewMatrixAsLookAt is changed
_eye_old=_eye_new;
_center_old=_center_old;
}
}
osg::Image* _depth;
osg::Image* _color;
osgViewer::Viewer* _viewer;
osg::Vec3f _eye_new;
osg::Vec3f _center_new;
osg::Vec3f _up_new;
osg::Vec3f _eye_old;
osg::Vec3f _center_old;
};
报错
错误 1 error C2664: “void osg::Camera::getViewMatrixAsLookAt(osg::Vec3f &,osg::Vec3f &,osg::Vec3f &,float) const”: 无法将参数 1 从“const osg::Vec3f”转换为“osg::Vec3d &” c:\users\vgp\desktop\mytreemodeling\imagematriculated\myclasses.h 78 1 ImageMatriculated
|
|