void cCritterViewer::resetAndMatchMoveBox(cGame *pgame) { _proportionofworldtoshow = cCritterViewer::PROPORTIONOFWORLDTOSHOW; _aspect = 4.0/3.0; _fieldofviewangle = cCritterViewer::STARTFIELDOFVIEWANGLE; _trackplayer = FALSE; _perspective = FALSE; //Will be reset by setViewpoint, _foveaproportion = cCritterViewer::FOVEAPROPORTION; _wrapflag = cCritter::CLAMP; /* I had WRAP, which was a big mistake, as sometimes I'd back way up above the world and then suddenly be under it. */ _dragbox = _movebox = cRealBox(pgame->border().center(), MOVEBOXTOGAMEBORDERRATIO * pgame->border().maxsize()); /* Put the viewer in a cube (or square in the 2D case) whose edge is a multiple of the world's largest dimension. */ //We will set _znear and _zfar in the cCritterViewer::setZClipPlanes call. setViewpoint(); /* Default viewpoint is up the z axis looking down at the origin. This call also initializes some of the remaining vairables. */ zoom(1.0); //Matches _fieldofviewangle to _proportionofworldtoshow /* Don't bother to set a listener, as the various cGame::initializeView will do that indirectly via a setGraphicsClass call, and then possibly with a direct call to change the listener again. */ setDensity(0.0); //so you don't move things you bump into. setAbsorberflag(TRUE); //So you don't bounce when you bump things. psprite()->setRadius(0.1); /* Although this guy is invisible, it seems to be good to have a radius of 1.0 for use in the COLLIDEVIEWER code. */ }
CGraphics::CGraphics(QGLWidget* _owner) { owner = _owner; float xyz[3] = {0.8317f,-0.9817f,0.8000f}; float hpr[3] = {121.0000f,-27.5000f,0.0000f}; setViewpoint (xyz,hpr); sphere_quality = 1; m_renderDepth = 100; graphicDisabled = false; }
void Camera::setViewpoint(double x, double y, double z) { setViewpoint(Viewpoint(x, y, z)); }
void MapManipulator::untilt(double duration) { osgEarth::Util::Viewpoint viewpoint = getViewpoint(); viewpoint.setPitch(-90); setViewpoint(viewpoint, duration); }
void MapManipulator::resetNorth(double duration) { osgEarth::Util::Viewpoint viewpoint = getViewpoint(); viewpoint.setHeading(0); setViewpoint(viewpoint, duration); }