|
本帖最后由 dreamsmile117 于 2013-3-18 09:03 编辑
大家好,是这样的。为了让船运动写了这样一段代码
private:osg::MatrixTransform* boatTransform;
osg::Vec3f m_boatPosition;
SceneEventHandler( SceneModel* scene, TextHUD* textHUD, osgViewer::Viewer& viewer,osg::MatrixTransform* boatPosition ):
_scene(scene),
_textHUD(textHUD),
_viewer(viewer),
_currentCameraMode(FIXED),
m_boatPosition(boatPosition)
{
boatTransform=boatPosition;
boatTransform->setMatrix(osg::Matrix::translate(osg::Vec3f(0.0f,150.0f,0.0f)));
//m_boatPosition=
m_boatPosition=(osg::Vec3f(0.0f,150.0f,0.0f));
boatSpeed=0.2;
m_fAngle=0;
....}
老是报错:3>..\..\..\src\oceanExample\application.cpp(571) : error C2664: “osg::Vec3f::Vec3f(const osg::Vec3f &)”: 不能将参数 1 从“osg::MatrixTransform *”转换为“const osg::Vec3f &”
3> 原因如下: 无法从“osg::MatrixTransform *”转换为“const osg::Vec3f”
请问是不是VEC3F的格式没办法转化成TRANSFORM?
该如何转换? |
|