Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages

projection.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                        projection.h  -  Projection modes
00003                              -------------------
00004     begin                : Thu Mar 27 2003
00005     copyright            : (C) 2003 by Reality Rift Studios
00006     email                : mattias@realityrift.com
00007  ***************************************************************************
00008 
00009  The contents of this file are subject to the Mozilla Public License Version
00010  1.1 (the "License"); you may not use this file except in compliance with
00011  the License. You may obtain a copy of the License at 
00012  http://www.mozilla.org/MPL/
00013 
00014  Software distributed under the License is distributed on an "AS IS" basis,
00015  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00016  for the specific language governing rights and limitations under the
00017  License.
00018 
00019  The Original Code is the NeoEngine, projection.h
00020 
00021  The Initial Developer of the Original Code is Mattias Jansson.
00022  Portions created by Mattias Jansson are Copyright (C) 2003
00023  Reality Rift Studios. All Rights Reserved.
00024 
00025  ***************************************************************************/
00026 
00027 
00028 #ifndef __NEPROJECTION_H
00029 #define __NEPROJECTION_H
00030 
00031 
00037 #include "base.h"
00038 #include "nemath.h"
00039 
00040 
00041 namespace NeoEngine
00042 {
00043 
00044 
00046 class Viewport;
00047 
00048 
00049 
00050 
00051 
00057 class NEOENGINE_API Projection
00058 {
00059     public:
00060 
00065         enum PROJECTIONMODE
00066         {
00068           INVALIDPROJECTION                           = -1,
00069 
00071           PERSPECTIVE                                 = 0,
00072 
00074           ORTHOGRAPHIC                                = 1,
00075 
00077           CUSTOM                                      = 2
00078         };
00079 
00080 
00082         PROJECTIONMODE                                m_eMode;
00083 
00085         float                                         m_fZNear;
00086 
00088         float                                         m_fZFar;
00089 
00091         Matrix                                        m_kMatrix;
00092 
00093 
00096                                                       Projection();
00097 
00102         virtual void                                  BuildProjection( const Viewport &rkViewport ) {}
00103 };
00104 
00105 
00106 
00107 
00108 
00114 class NEOENGINE_API PerspectiveProjection : public Projection
00115 {
00116     public:
00117 
00119         float                                         m_fFOV;
00120 
00124                                                       PerspectiveProjection();
00125 
00126 
00131         virtual void                                  BuildProjection( const Viewport &rkViewport );
00132 };
00133 
00134 
00135 
00136 
00137 
00138 
00139 
00145 class NEOENGINE_API OrthographicProjection : public Projection
00146 {
00147     public:
00148 
00150         float                                         m_fLeft;
00151 
00153         float                                         m_fTop;
00154 
00156         float                                         m_fRight;
00157 
00159         float                                         m_fBottom;
00160 
00162         float                                         m_fZNear;
00163 
00165         float                                         m_fZFar;
00166 
00170                                                       OrthographicProjection();
00171 
00172 
00177         virtual void                                  BuildProjection( const Viewport &rkViewport );
00178 };
00179 
00180 
00181 }; // namespace NeoEngine
00182 
00183 
00184 #endif  // __NEPROJECTION_H
00185 

Generated on Wed Jan 21 14:21:07 2004 for NeoEngine by doxygen 1.3.5