a434abafd7
Updates to the osg::Transform, adding preMult and postMult methods and deprecating the old preRotate,preTranslate,preScale. Updated the rest of the OSG so that it nolonger uses the deprecated osg::Transform nodes. Renamed osgUtil::SceneView::setGlobalState() to osgUtil::SceneView::setGlobalStateSet() so that the name reflects its functionality better. Updated osgGLUT::Viewer etc to cope with new name change.
40 lines
897 B
C++
40 lines
897 B
C++
#include <osgUtil/SceneViewManipulator>
|
|
#include <osgUtil/TrackballManipulator>
|
|
|
|
using namespace osgUtil;
|
|
|
|
SceneViewManipulator::SceneViewManipulator():
|
|
_cm(new TrackballManipulator),
|
|
_gm(new StateSetManipulator)
|
|
{
|
|
}
|
|
|
|
SceneViewManipulator::~SceneViewManipulator()
|
|
{
|
|
}
|
|
|
|
void SceneViewManipulator::setSceneView(SceneView* sv)
|
|
{
|
|
_sv=sv;
|
|
_cm->setNode(sv->getSceneData());
|
|
_cm->setCamera(sv->getCamera());
|
|
_gm->setStateSet(sv->getGlobalStateSet());
|
|
}
|
|
|
|
SceneView *SceneViewManipulator::getSceneView()
|
|
{
|
|
return _sv.get();
|
|
}
|
|
|
|
const SceneView *SceneViewManipulator::getSceneView() const
|
|
{
|
|
return _sv.get();
|
|
}
|
|
|
|
bool SceneViewManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& aa)
|
|
{
|
|
if(_cm->handle(ea,aa)) return true;
|
|
if(_gm->handle(ea,aa)) return true;
|
|
return false;
|
|
}
|