|
本帖最后由 liushui 于 2011-9-16 10:39 编辑
各位帅哥美女进来看下
我的程序提示:
错误 1 error C2512: “PickHandler”: 没有合适的默认构造函数可用
相关代码:
PickHandler.h
-------------------------------------------------
#include <osgViewer/Viewer>
#include <osg/MatrixTransform>
//类的声明
// PickHandler -- A GUIEventHandler that implements picking.
class PickHandler;
// Derive a class from NodeCallback to manipulate a MatrixTransform object's matrix.
class RotateCB;
PickHandler.cpp
-------------------------------------------------
#include "../include/PickHandler.h"
class PickHandler : public osgGA::GUIEventHandler
{
public:
PickHandler() : _mX( 0. ),_mY( 0. ) {}
bool handle( const osgGA::GUIEventAdapter& ea,
osgGA::GUIActionAdapter& aa )
{
。。。
main.cpp
-------------------------------------------------
#include "../include/main.h"
#include "../include/PickHandler.h"
int main()
{
。。。
//设置场景数据
viewer->setSceneData(root.get());
//初始化并创建窗口
viewer->realize();
viewer->addEventHandler(new PickHandler());
//开始渲染
viewer->run();
return 0 ;
}
请哪位大侠有空帮我看下啦 |
|