00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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
00111 gl::Renderer m_render;
00112
00113 std::vector<Object3d*> m_vec3d;
00114
00115 std::vector<Billboard*> m_billboards;
00116
00117 std::vector<Object2d*> m_vec2d;
00118
00119 std::vector<Model*> m_models;
00120
00121 std::vector<Light*> m_lights;
00122
00123 static core::Bsp* m_bsp;
00124
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 }
00137 #endif