Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

sglPerspectiveCamera.hpp

00001 /*****************************************************************************
00002  * SGL: A Scene Graph Library
00003  *
00004  * Copyright (C) 1997-2001  Scott McMillan   All Rights Reserved.
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Library General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Library General Public
00017  * License along with this library; if not, write to the Free
00018  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  *****************************************************************************
00020  *     File: sglPerspectiveCamera.hpp
00021  *   Author: Scott McMillan
00022  *  Created: 19 December 2000
00023  *  Summary: Perspective camera class
00024  *****************************************************************************/
00025 
00026 #ifndef __SGL_PERSPECTIVE_CAMERA_HPP
00027 #define __SGL_PERSPECTIVE_CAMERA_HPP
00028 
00029 #include <sglCamera.hpp>
00030 
00057 class SGL_DLL_API sglPerspectiveCamera : public sglCamera
00058 {
00059 public:
00061    sglPerspectiveCamera();
00062 
00064    virtual ~sglPerspectiveCamera();
00065 
00081    bool setFOV(double fovy, double aspect, double near_clip, double far_clip);
00082 
00088    bool getFOV(double &fovy, double &aspect,
00089                double &near_clip, double &far_clip) const;
00090 
00092    double getFOVY() const { return m_frustum.getFOVY(); }
00094    double getFOVX() const { return m_fovx; }
00095 
00108    void setSimple(double  left, double  right, double  bottom, double  top,
00109                   double near_clip, double far_clip);
00110 
00113    void getSimple(double &left, double &right, double &bottom, double &top,
00114                   double &near_clip, double &far_clip) const;
00115 
00116    // See sglCamera::applyProjection() for details.
00117    virtual void applyProjection() const;
00118 
00119    // See sglObject::printInfo() for details.
00120    virtual void printInfo(ostream &ostrm, const char *indent_string) const;
00121 
00122 protected:
00123    sglPerspectiveCamera(const sglPerspectiveCamera &);
00124    sglPerspectiveCamera &operator=(const sglPerspectiveCamera &);
00125 
00126 protected:
00127    bool m_simple_flag;
00128 
00129    double m_left;
00130    double m_right;
00131    double m_bottom;
00132    double m_top;
00133 
00134    double m_fovx;   // radians (computed internally)
00135 };
00136 
00137 #endif

Generated at Mon Jul 1 18:00:05 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001