void CameraManipulator::setNode(osg::Node* node)
{
    _node = node;
    if (_node.get())
    {
        const osg::BoundingSphere& boundingSphere=_node->getBound();
        _modelScale = boundingSphere._radius;
    }
    if (getAutoComputeHomePosition()) computeHomePosition();
}
Esempio n. 2
0
 void QOSGWidget::setSceneData(osg::Node* node) {
     osgViewer::Viewer::setSceneData(node);
     getCameraManipulator()->setNode(node);
     computeHomePosition();
 }
void CameraManipulator::home(double /*currentTime*/)
{
    if (getAutoComputeHomePosition()) computeHomePosition();
    computePosition(_homeEye, _homeCenter, _homeUp);
    _thrown = false;
}