Further work on cleaning up SceneView and Camera, in particular moving strereo

support out of Camera and into SceneView. Also enabled the option to set the
projection and modelview matrices directly on SceneView thereby removing the
dependance on osg::Camrea to control the view of the scene.
This commit is contained in:
Robert Osfield
2002-04-12 18:06:13 +00:00
parent 468580a12c
commit 341ffb2361
6 changed files with 77 additions and 162 deletions

View File

@@ -242,17 +242,6 @@ class SG_EXPORT Camera: public osg::Referenced
* equivalent to using gluLookAt.*/
const Matrix& getModelViewMatrix() const;
/** Switch on/off the use of the near and far clipping plane which creating the
* getClippingVolume(), uses the camera _zfar value for the position
* of the far clipping plane. By default this value is off.*/
void setUseNearAndFarClippingPlanes(const bool use);
/** Get whether the ClippingVolume uses a near and far clipping planes.*/
const bool getUseNearAndFarClippingPlanes() const { return _useNearAndFarClippingPlanes; }
/** get the view frustum clipping in model coordinates */
const ClippingVolume& getClippingVolume() const;
/** Map object coordinates into windows coordinates.
* Equivalent to gluProject(...). */
@@ -297,15 +286,6 @@ class SG_EXPORT Camera: public osg::Referenced
/** Get the physical distance between the viewers eyes and the display system.*/
const float getScreenDistance() const { return _screenDistance; }
/** Convinience method for adjusting the project and model view to account for
* and eye offset, as used in stereo work, assumes that the users will use
* a seperate camera for each eye, adjustEyePointForStereo(..) being used to
* specialize the camera for each eye view.*/
void adjustEyeOffsetForStereo(const osg::Vec3& offset);
/** Set up the OpenGL projection and model view matrices.*/
virtual void apply(State& state);
protected:
@@ -352,11 +332,8 @@ class SG_EXPORT Camera: public osg::Referenced
mutable ref_ptr<Matrix> _mp;
mutable ref_ptr<Matrix> _inversemp;
void calculateMatricesAndClippingVolume() const;
void computeMatrices() const;
// used for offsetting camera to ajust for left and right stereo views.
bool _useEyeOffset;
osg::Vec3 _eyeOffset;
float _screenDistance;
FusionDistanceMode _fusionDistanceMode;

View File

@@ -8,7 +8,6 @@
#include <osg/Vec2>
#include <osg/BoundingSphere>
#include <osg/Drawable>
#include <osg/Camera>
#include <osg/ImpostorSprite>
#include <osg/AlphaFunc>
#include <osg/TexEnv>

View File

@@ -10,8 +10,8 @@
#include <osg/Matrix>
#include <osg/FrameStamp>
#include <osg/Camera>
#include <osg/DisplaySettings>
#include <osg/ClippingVolume>
#include <vector>
#include <map>