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 _SKYBOX_H
00026 #define _SKYBOX_H
00027
00028 #ifdef WIN32
00029 #include <windows.h>
00030 #endif
00031
00032
00033 #include "box.h"
00034 #include <string>
00035
00036 #define NGN_FACE_BACK 0
00037 #define NGN_FACE_FRONT 1
00038 #define NGN_FACE_LEFT 2
00039 #define NGN_FACE_RIGHT 3
00040 #define NGN_FACE_TOP 4
00041 #define NGN_FACE_BOTTOM 5
00042 #define NGN_FACE_ALL 6 // use same texture for all sides
00043
00044
00045 namespace ngn {
00046
00047 namespace core {
00048 class Texture;
00049 }
00050
00054 class NGN_API Skybox : public Box
00055 {
00056 public:
00058 Skybox();
00060 Skybox( float width, float height, float length );
00062 Skybox( const Vector3df min, const Vector3df& max );
00064 Skybox( const Skybox& other );
00065
00066 virtual ~Skybox();
00067
00069 void setEnvironmentMap( const std::string& path );
00071 void setFaceTexture( unsigned int face, const std::string& file );
00073 virtual void render( const Camera& cam );
00074
00075
00076 protected:
00078 virtual void computeCentre();
00079
00080 private:
00081 std::string m_envmappath;
00082 unsigned int *m_texid;
00083 Texture *m_tex;
00084 bool m_use_envmap;
00085 bool m_use_face_by_face;
00086
00087 };
00088
00089
00090
00091
00092 }
00093
00094 #endif
00095
00096