Page principale | Hiérarchie des classes | Liste alphabétique | Liste des classes | Liste des fichiers | Membres de classe

C:/Projects/ngn/include/scene.h

00001 /***************************************************************************
00002  *            scene.h
00003  *
00004  *  Mon Sep 13 18:28:44 2004
00005  *  Copyright  2004  thierry schartz
00006  *  thierry.schartz@bluebottle.com
00007  ****************************************************************************/
00008 
00009 /*
00010  *  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version.
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU Library General Public License for more details.
00019  *
00020  *  You should have received a copy of the GNU General Public License
00021  *  along with this program; if not, write to the Free Software
00022  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00023  */
00024  
00025 #ifndef _SCENE_H
00026 #define _SCENE_H
00027 
00028 #ifdef WIN32
00029 #include <windows.h>
00030 #endif
00031 
00032 #include <vector>
00033 #include "renderer.h"
00034 #include "collision.h"
00035 #include "build.h"
00036 
00037 namespace ngn {
00038 
00039                 class Object3d;
00040                 class Object2d;
00041                 class Camera;
00042                 class Model;
00043                 class Light;
00044                 class Billboard;
00045 
00046                 namespace core { 
00047                         class Bsp;
00048                         class Vector3df;
00049                 }
00050 
00051 
00057         class NGN_API Scene
00058         {
00059         
00060         public:
00061                         Scene();
00062                         virtual ~Scene();
00063                         
00065                         void renderScene();
00067                         void addBSP( const char* bspfile );
00069                         bool loadBSP();
00071                         void clear();
00073                         int add3D( Object3d* object3d );
00075                         int add2D( Object2d* object2d );
00077                         int addModel( Model* model );
00079                         int addLight( Light* light );
00081                         int addBillboard( Billboard* billboard );
00082 
00084                         void remove3D(  int id );
00086                         void remove2D(  int id );
00088                         void removeModel(  int id );
00090                         void removeLight(  int id );
00092                         void removeBillboard(  int id );
00093 
00095                         int getObjectListSize() const;
00097                         Camera& getCamera();
00099                         void setGrid( int x, int z );
00101                         void showGrid( bool state );
00102 
00104                         const core::Vector3df& getEntryPoint( unsigned int index ) const;
00106                         const core::Vector3df& getRandomEntryPoint() const;
00107                         
00108 
00109         private:
00110                         // the renderer
00111                         gl::Renderer m_render;
00112                         // vector of 3D objects
00113                         std::vector<Object3d*> m_vec3d;
00114                         // vector of billboarded objects
00115                         std::vector<Billboard*> m_billboards;
00116                         // vector of 2D objects
00117                         std::vector<Object2d*> m_vec2d;
00118                         // vector of models
00119                         std::vector<Model*> m_models;
00120                         // vector of lights
00121                         std::vector<Light*> m_lights;
00122                         // bsp
00123                         static core::Bsp* m_bsp;
00124                         // bsp file path
00125                         const char* m_bspfile;
00126                         
00127 
00128                         friend class gl::Renderer;
00129                         friend class Camera;
00130                         friend class Collision;
00131                 
00132         };
00133         
00134         
00135         
00136 }//ngn
00137 #endif /* _SCENE_H */

Généré le Fri Nov 19 14:20:29 2004 pour NGN par  doxygen 1.3.9.1