Blender  V2.59
BlenderWorldInfo.h
Go to the documentation of this file.
00001 /*
00002  * $Id: BlenderWorldInfo.h 35063 2011-02-22 10:33:14Z jesterking $
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program 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
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00021  * All rights reserved.
00022  *
00023  * The Original Code is: all of this file.
00024  *
00025  * Contributor(s): none yet.
00026  *
00027  * ***** END GPL LICENSE BLOCK *****
00028  */
00029 
00034 #ifndef __BLENDERWORLDINFO_H
00035 #define __BLENDERWORLDINFO_H
00036 #include "MT_CmMatrix4x4.h"
00037 #include "KX_WorldInfo.h"
00038 #include "KX_BlenderGL.h"
00039 
00040 class BlenderWorldInfo : public KX_WorldInfo
00041 {
00042         bool                    m_hasworld;
00043         float                   m_backgroundcolor[3];
00044 
00045         bool                    m_hasmist;
00046         float                   m_miststart;
00047         float                   m_mistdistance;
00048         float                   m_mistcolor[3];
00049 
00050         float                   m_ambientcolor[3];
00051 
00052 public:
00053         BlenderWorldInfo(struct Scene *blenderscene, struct World* blenderworld);
00054         ~BlenderWorldInfo();
00055 
00056         bool    hasWorld();
00057     bool        hasMist();
00058     float       getBackColorRed();
00059     float       getBackColorGreen();
00060     float       getBackColorBlue();
00061         
00062         float   getAmbientColorRed();
00063         float   getAmbientColorGreen();
00064         float   getAmbientColorBlue();
00065 
00066     float       getMistStart();
00067     float       getMistDistance();
00068     float       getMistColorRed();
00069     float       getMistColorGreen();
00070     float       getMistColorBlue();     
00071 
00072                 void
00073         setBackColor(
00074                 float r,
00075                 float g,
00076                 float b
00077         );
00078                 void    
00079         setMistStart(
00080                 float d
00081         );
00082 
00083                 void    
00084         setMistDistance(
00085                 float d
00086         );
00087 
00088                 void    
00089         setMistColorRed(
00090                 float d
00091         );
00092 
00093                 void    
00094         setMistColorGreen(
00095                 float d
00096         );
00097 
00098                 void    
00099         setMistColorBlue(
00100                 float d
00101         );   
00102         
00103         
00104 #ifdef WITH_CXX_GUARDEDALLOC
00105 public:
00106         void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BlenderWorldInfo"); }
00107         void operator delete( void *mem ) { MEM_freeN(mem); }
00108 #endif
00109 };
00110 
00111 #endif //__BLENDERWORLDINFO_H
00112