Added osg::Camera::ProjectionResizePolicy enum and associated methods for controlling

how the field of view is adjust on window resizes.
This commit is contained in:
Robert Osfield
2007-05-22 09:32:38 +00:00
parent d22208f701
commit 5056f6fee6
4 changed files with 47 additions and 29 deletions

View File

@@ -123,6 +123,19 @@ class OSG_EXPORT Camera : public Transform, public CullSettings
/** Get the transformation order.*/
TransformOrder getTransformOrder() const { return _transformOrder; }
enum ProjectionResizePolicy
{
FIXED, /** Keep the projection matrix fixed, despite window resizes.*/
HORIZONTAL, /** Adjust the HORIZOTNAL field of view on window resizes.*/
VERTICAL /** Adjust the VERTICAL field of view on window resizes.*/
};
/** Set the policy used to determin if and how the projection matrix should be adjusted on window resizes. */
inline void setProjectionResizePolicy(ProjectionResizePolicy policy) { _projectionResizePolicy = policy; }
/** Get the policy used to determin if and how the projection matrix should be adjusted on window resizes. */
inline ProjectionResizePolicy getProjectionResizePolicy() const { return _projectionResizePolicy; }
/** Set the projection matrix. Can be thought of as setting the lens of a camera. */
inline void setProjectionMatrix(const osg::Matrixf& matrix) { _projectionMatrix.set(matrix); }
@@ -417,6 +430,8 @@ class OSG_EXPORT Camera : public Transform, public CullSettings
ref_ptr<Viewport> _viewport;
TransformOrder _transformOrder;
ProjectionResizePolicy _projectionResizePolicy;
Matrixd _projectionMatrix;
Matrixd _viewMatrix;