lugre_caelum_L.cpp

Go to the documentation of this file.
00001 #ifdef USE_LUGRE_LIB_CAELUM
00002 
00003 #include "lugre_prefix.h"
00004 #include "lugre_scripting.h"
00005 #include "lugre_luabind.h"
00006 #include "lugre_ogrewrapper.h"
00007 #include "lugre_camera.h"
00008 
00009 #include "Caelum.h"
00010 #include <stdio.h>
00011 
00012 extern "C" {
00013     #include "lua.h"
00014     #include "lauxlib.h"
00015     #include "lualib.h"
00016 }
00017 
00018 
00019 #define PUSH_COLOURVALUE(ogrecolor) {lua_pushnumber(L,ogrecolor.r);lua_pushnumber(L,ogrecolor.g);lua_pushnumber(L,ogrecolor.b);lua_pushnumber(L,ogrecolor.a);}
00020 #define CHECK_COLOURVALUE(ogrecolor,index)  {ogrecolor.r = luaL_checknumber(L,(index)+0);ogrecolor.g = luaL_checknumber(L,(index)+1);ogrecolor.b = luaL_checknumber(L,(index)+2);ogrecolor.a = luaL_checknumber(L,(index)+3);}
00021 
00022 #define PUSH_VECTOR2(v) {lua_pushnumber(L,v.x);lua_pushnumber(L,v.y);}
00023 #define CHECK_VECTOR2(v,index)  {v.x = luaL_checknumber(L,(index)+0);v.y = luaL_checknumber(L,(index)+1);}
00024 
00025 #define PUSH_VECTOR3(v) {lua_pushnumber(L,v.x);lua_pushnumber(L,v.y);lua_pushnumber(L,v.z);}
00026 #define CHECK_VECTOR3(v,index)  {v.x = luaL_checknumber(L,(index)+0);v.y = luaL_checknumber(L,(index)+1);v.z = luaL_checknumber(L,(index)+2);}
00027 
00028 
00029 namespace Lugre {
00030 
00031     // ##########################################################################################
00032     // ##########################################################################################
00033     // ##########################################################################################
00034 
00035 // NAMESPACE caelum
00036 // Caelum::CLASS Astronomy
00037 
00038         class cCaelumAstronomy_L : public cLuaBind<Caelum::Astronomy> { public:
00039             virtual void RegisterMethods    (lua_State *L) { PROFILE
00040                 //lua_register(L,"CreateCaelumAstronomy",    &cCaelumAstronomy_L::CreateCaelumAstronomy);
00041             
00042                 #define REGISTER_METHOD(methodname) mlMethod.push_back(make_luaL_reg(#methodname,&cCaelumAstronomy_L::methodname));     
00043                 
00044                         REGISTER_METHOD(ConvertEclipticToEquatorialRad);    // Caelum::Astronomy::FUNCTION void : convertEclipticToEquatorialRad : 4 params             
00045                         REGISTER_METHOD(ConvertRectangularToSpherical); // Caelum::Astronomy::FUNCTION void : convertRectangularToSpherical : 6 params              
00046                         REGISTER_METHOD(ConvertSphericalToRectangular); // Caelum::Astronomy::FUNCTION void : convertSphericalToRectangular : 6 params              
00047                         REGISTER_METHOD(ConvertEquatorialToHorizontal); // Caelum::Astronomy::FUNCTION void : convertEquatorialToHorizontal : 7 params              
00048                         REGISTER_METHOD(GetHorizontalSunPosition1); // Caelum::Astronomy::FUNCTION void : getHorizontalSunPosition : 5 params               
00049                         REGISTER_METHOD(GetHorizontalSunPosition2); // Caelum::Astronomy::FUNCTION void : getHorizontalSunPosition : 5 params               
00050                         REGISTER_METHOD(GetEclipticMoonPositionRad);    // Caelum::Astronomy::FUNCTION void : getEclipticMoonPositionRad : 3 params             
00051                         REGISTER_METHOD(GetHorizontalMoonPosition1);    // Caelum::Astronomy::FUNCTION void : getHorizontalMoonPosition : 5 params              
00052                         REGISTER_METHOD(GetHorizontalMoonPosition2);    // Caelum::Astronomy::FUNCTION void : getHorizontalMoonPosition : 5 params              
00053                         REGISTER_METHOD(GetJulianDayFromGregorianDate); // Caelum::Astronomy::FUNCTION int : getJulianDayFromGregorianDate : 3 params               
00054                         REGISTER_METHOD(GetJulianDayFromGregorianDateTime1);    // Caelum::Astronomy::FUNCTION double : getJulianDayFromGregorianDateTime : 6 params                
00055                         REGISTER_METHOD(GetJulianDayFromGregorianDateTime2);    // Caelum::Astronomy::FUNCTION double : getJulianDayFromGregorianDateTime : 4 params                
00056                         REGISTER_METHOD(GetGregorianDateFromJulianDay1);    // Caelum::Astronomy::FUNCTION void : getGregorianDateFromJulianDay : 4 params              
00057                         REGISTER_METHOD(GetGregorianDateTimeFromJulianDay); // Caelum::Astronomy::FUNCTION void : getGregorianDateTimeFromJulianDay : 7 params              
00058                         REGISTER_METHOD(GetGregorianDateFromJulianDay2);    // Caelum::Astronomy::FUNCTION void : getGregorianDateFromJulianDay : 4 params              
00059                         REGISTER_METHOD(EnterHighPrecissionFloatingPointMode);  // Caelum::Astronomy::FUNCTION int : enterHighPrecissionFloatingPointMode : 0 params                
00060                         REGISTER_METHOD(RestoreFloatingPointMode);  // Caelum::Astronomy::FUNCTION void : restoreFloatingPointMode : 1 params               
00061         // NAMESPACE caelum
00062             
00063                 REGISTER_METHOD(Destroy);    
00064                 
00065                 #undef REGISTER_METHOD
00066             }
00067             virtual const char* GetLuaTypeName () { return "lugre.caelum.astronomy"; }
00068 
00070                 static int  Destroy         (lua_State *L) { PROFILE
00071                     delete checkudata_alive(L);
00072                     return 0;
00073                 }
00074                 
00075             
00077             static int  ConvertEclipticToEquatorialRad  (lua_State *L) { PROFILE
00078                 // int argc = lua_gettop(L);
00079                 double p0 = luaL_checknumber(L, 2);
00080                 double p1 = luaL_checknumber(L, 3);
00081                 double p2 = luaL_checknumber(L, 4);
00082                 double p3 = luaL_checknumber(L, 5);
00083                 
00084                 checkudata_alive(L)->convertEclipticToEquatorialRad(p0, p1, p2, p3);
00085                 
00086                 return 0;
00087             }
00088 
00090             static int  ConvertRectangularToSpherical   (lua_State *L) { PROFILE
00091                 // int argc = lua_gettop(L);
00092                 double p0 = luaL_checknumber(L, 2);
00093                 double p1 = luaL_checknumber(L, 3);
00094                 double p2 = luaL_checknumber(L, 4);
00095                 double p3 = luaL_checknumber(L, 5);
00096                 double p4 = luaL_checknumber(L, 6);
00097                 double p5 = luaL_checknumber(L, 7);
00098                 
00099                 checkudata_alive(L)->convertRectangularToSpherical(p0, p1, p2, p3, p4, p5);
00100                 
00101                 return 0;
00102             }
00103 
00105             static int  ConvertSphericalToRectangular   (lua_State *L) { PROFILE
00106                 // int argc = lua_gettop(L);
00107                 double p0 = luaL_checknumber(L, 2);
00108                 double p1 = luaL_checknumber(L, 3);
00109                 double p2 = luaL_checknumber(L, 4);
00110                 double p3 = luaL_checknumber(L, 5);
00111                 double p4 = luaL_checknumber(L, 6);
00112                 double p5 = luaL_checknumber(L, 7);
00113                 
00114                 checkudata_alive(L)->convertSphericalToRectangular(p0, p1, p2, p3, p4, p5);
00115                 
00116                 return 0;
00117             }
00118 
00120             static int  ConvertEquatorialToHorizontal   (lua_State *L) { PROFILE
00121                 // int argc = lua_gettop(L);
00122                 double p0 = luaL_checknumber(L, 2);
00123                 double p1 = luaL_checknumber(L, 3);
00124                 double p2 = luaL_checknumber(L, 4);
00125                 double p3 = luaL_checknumber(L, 5);
00126                 double p4 = luaL_checknumber(L, 6);
00127                 double p5 = luaL_checknumber(L, 7);
00128                 double p6 = luaL_checknumber(L, 8);
00129                 
00130                 checkudata_alive(L)->convertEquatorialToHorizontal(p0, p1, p2, p3, p4, p5, p6);
00131                 
00132                 return 0;
00133             }
00134 
00136             static int  GetHorizontalSunPosition1   (lua_State *L) { PROFILE
00137                 // int argc = lua_gettop(L);
00138                 double p0 = luaL_checknumber(L, 2);
00139                 double p1 = luaL_checknumber(L, 3);
00140                 double p2 = luaL_checknumber(L, 4);
00141                 double p3 = luaL_checknumber(L, 5);
00142                 double p4 = luaL_checknumber(L, 6);
00143                 
00144                 checkudata_alive(L)->getHorizontalSunPosition(p0, p1, p2, p3, p4);
00145                 
00146                 return 0;
00147             }
00148 
00150             static int  GetHorizontalSunPosition2   (lua_State *L) { PROFILE
00151                 // int argc = lua_gettop(L);
00152                 double p0 = luaL_checknumber(L, 2);
00153                 Ogre::Degree p1((Ogre::Real)luaL_checknumber(L, 3));
00154                 Ogre::Degree p2((Ogre::Real)luaL_checknumber(L, 4));
00155                 Ogre::Degree p3((Ogre::Real)luaL_checknumber(L, 5));
00156                 Ogre::Degree p4((Ogre::Real)luaL_checknumber(L, 6));
00157                 
00158                 checkudata_alive(L)->getHorizontalSunPosition(p0, p1, p2, p3, p4);
00159                 
00160                 return 0;
00161             }
00162 
00164             static int  GetEclipticMoonPositionRad  (lua_State *L) { PROFILE
00165                 // int argc = lua_gettop(L);
00166                 double p0 = luaL_checknumber(L, 2);
00167                 double p1 = luaL_checknumber(L, 3);
00168                 double p2 = luaL_checknumber(L, 4);
00169                 
00170                 checkudata_alive(L)->getEclipticMoonPositionRad(p0, p1, p2);
00171                 
00172                 return 0;
00173             }
00174 
00176             static int  GetHorizontalMoonPosition1  (lua_State *L) { PROFILE
00177                 // int argc = lua_gettop(L);
00178                 double p0 = luaL_checknumber(L, 2);
00179                 double p1 = luaL_checknumber(L, 3);
00180                 double p2 = luaL_checknumber(L, 4);
00181                 double p3 = luaL_checknumber(L, 5);
00182                 double p4 = luaL_checknumber(L, 6);
00183                 
00184                 checkudata_alive(L)->getHorizontalMoonPosition(p0, p1, p2, p3, p4);
00185                 
00186                 return 0;
00187             }
00188 
00190             static int  GetHorizontalMoonPosition2  (lua_State *L) { PROFILE
00191                 // int argc = lua_gettop(L);
00192                 double p0 = luaL_checknumber(L, 2);
00193                 Ogre::Degree p1((Ogre::Real)luaL_checknumber(L, 3));
00194                 Ogre::Degree p2((Ogre::Real)luaL_checknumber(L, 4));
00195                 Ogre::Degree p3((Ogre::Real)luaL_checknumber(L, 5));
00196                 Ogre::Degree p4((Ogre::Real)luaL_checknumber(L, 6));
00197                 
00198                 checkudata_alive(L)->getHorizontalMoonPosition(p0, p1, p2, p3, p4);
00199                 
00200                 return 0;
00201             }
00202 
00204             static int  GetJulianDayFromGregorianDate   (lua_State *L) { PROFILE
00205                 // int argc = lua_gettop(L);
00206                 int p0 = luaL_checknumber(L, 2);
00207                 int p1 = luaL_checknumber(L, 3);
00208                 int p2 = luaL_checknumber(L, 4);
00209                 
00210                 int r = checkudata_alive(L)->getJulianDayFromGregorianDate(p0, p1, p2);
00211                 
00212                 lua_pushnumber(L, r);
00213                 return 1;
00214             }
00215 
00217             static int  GetJulianDayFromGregorianDateTime1  (lua_State *L) { PROFILE
00218                 // int argc = lua_gettop(L);
00219                 int p0 = luaL_checknumber(L, 2);
00220                 int p1 = luaL_checknumber(L, 3);
00221                 int p2 = luaL_checknumber(L, 4);
00222                 int p3 = luaL_checknumber(L, 5);
00223                 int p4 = luaL_checknumber(L, 6);
00224                 double p5 = luaL_checknumber(L, 7);
00225                 
00226                 double r = checkudata_alive(L)->getJulianDayFromGregorianDateTime(p0, p1, p2, p3, p4, p5);
00227                 
00228                 lua_pushnumber(L, r);
00229                 return 1;
00230             }
00231 
00233             static int  GetJulianDayFromGregorianDateTime2  (lua_State *L) { PROFILE
00234                 // int argc = lua_gettop(L);
00235                 int p0 = luaL_checknumber(L, 2);
00236                 int p1 = luaL_checknumber(L, 3);
00237                 int p2 = luaL_checknumber(L, 4);
00238                 double p3 = luaL_checknumber(L, 5);
00239                 
00240                 double r = checkudata_alive(L)->getJulianDayFromGregorianDateTime(p0, p1, p2, p3);
00241                 
00242                 lua_pushnumber(L, r);
00243                 return 1;
00244             }
00245 
00247             static int  GetGregorianDateFromJulianDay1  (lua_State *L) { PROFILE
00248                 // int argc = lua_gettop(L);
00249                 int p0 = luaL_checknumber(L, 2);
00250                 int p1 = luaL_checknumber(L, 3);
00251                 int p2 = luaL_checknumber(L, 4);
00252                 int p3 = luaL_checknumber(L, 5);
00253                 
00254                 checkudata_alive(L)->getGregorianDateFromJulianDay(p0, p1, p2, p3);
00255                 
00256                 return 0;
00257             }
00258 
00260             static int  GetGregorianDateTimeFromJulianDay   (lua_State *L) { PROFILE
00261                 // int argc = lua_gettop(L);
00262                 double p0 = luaL_checknumber(L, 2);
00263                 int p1 = luaL_checknumber(L, 3);
00264                 int p2 = luaL_checknumber(L, 4);
00265                 int p3 = luaL_checknumber(L, 5);
00266                 int p4 = luaL_checknumber(L, 6);
00267                 int p5 = luaL_checknumber(L, 7);
00268                 double p6 = luaL_checknumber(L, 8);
00269                 
00270                 checkudata_alive(L)->getGregorianDateTimeFromJulianDay(p0, p1, p2, p3, p4, p5, p6);
00271                 
00272                 return 0;
00273             }
00274 
00276             static int  GetGregorianDateFromJulianDay2  (lua_State *L) { PROFILE
00277                 // int argc = lua_gettop(L);
00278                 double p0 = luaL_checknumber(L, 2);
00279                 int p1 = luaL_checknumber(L, 3);
00280                 int p2 = luaL_checknumber(L, 4);
00281                 int p3 = luaL_checknumber(L, 5);
00282                 
00283                 checkudata_alive(L)->getGregorianDateFromJulianDay(p0, p1, p2, p3);
00284                 
00285                 return 0;
00286             }
00287 
00289             static int  EnterHighPrecissionFloatingPointMode    (lua_State *L) { PROFILE
00290                 // int argc = lua_gettop(L);
00291                 
00292                 int r = checkudata_alive(L)->enterHighPrecissionFloatingPointMode();
00293                 
00294                 lua_pushnumber(L, r);
00295                 return 1;
00296             }
00297 
00299             static int  RestoreFloatingPointMode    (lua_State *L) { PROFILE
00300                 // int argc = lua_gettop(L);
00301                 int p0 = luaL_checknumber(L, 2);
00302                 
00303                 checkudata_alive(L)->restoreFloatingPointMode(p0);
00304                 
00305                 return 0;
00306             }
00307     
00308 
00309         };
00310         
00311             // Caelum::CLASS CaelumSystem
00312 
00313         class cCaelumCaelumSystem_L : public cLuaBind<Caelum::CaelumSystem> { public:
00314             virtual void RegisterMethods    (lua_State *L) { PROFILE
00315                 lua_register(L,"CreateCaelumCaelumSystem",    &cCaelumCaelumSystem_L::CreateCaelumCaelumSystem);
00316             
00317                 #define REGISTER_METHOD(methodname) mlMethod.push_back(make_luaL_reg(#methodname,&cCaelumCaelumSystem_L::methodname));      
00318                 
00319                         REGISTER_METHOD(Shutdown);  // Caelum::CaelumSystem::FUNCTION void : shutdown : 1 params                
00320                         REGISTER_METHOD(GetUniversalClock); // Caelum::CaelumSystem::FUNCTION UniversalClock : getUniversalClock : 0 params             
00321                         //REGISTER_METHOD(GetRootNode); // Caelum::CaelumSystem::FUNCTION Ogre::SceneNode* : getRootNode : 1 params             
00322                         REGISTER_METHOD(UpdateSubcomponents);   // Caelum::CaelumSystem::FUNCTION void : updateSubcomponents : 1 params             
00323                         REGISTER_METHOD(SetSkyDome);    // Caelum::CaelumSystem::FUNCTION void : setSkyDome : 1 params              
00324                         REGISTER_METHOD(GetSkyDome);    // Caelum::CaelumSystem::FUNCTION SkyDome : getSkyDome : 0 params               
00325                         REGISTER_METHOD(SetSun);    // Caelum::CaelumSystem::FUNCTION void : setSun : 1 params              
00326                         REGISTER_METHOD(GetSun);    // Caelum::CaelumSystem::FUNCTION BaseSkyLight* : getSun : 0 params             
00327                         REGISTER_METHOD(GetPrecipitationController);    // Caelum::CaelumSystem::FUNCTION PrecipitationController* : getPrecipitationController : 0 params              
00328                         REGISTER_METHOD(SetMoon);   // Caelum::CaelumSystem::FUNCTION void : setMoon : 1 params             
00329                         REGISTER_METHOD(GetMoon);   // Caelum::CaelumSystem::FUNCTION BaseSkyLight* : getMoon : 0 params                
00330                         REGISTER_METHOD(SetGroundFog);  // Caelum::CaelumSystem::FUNCTION void : setGroundFog : 1 params                
00331                         REGISTER_METHOD(GetGroundFog);  // Caelum::CaelumSystem::FUNCTION GroundFog* : getGroundFog : 0 params              
00332                         REGISTER_METHOD(SetManageSceneFog); // Caelum::CaelumSystem::FUNCTION void : setManageSceneFog : 1 params               
00333                         REGISTER_METHOD(GetManageSceneFog); // Caelum::CaelumSystem::FUNCTION bool : getManageSceneFog : 0 params               
00334                         REGISTER_METHOD(SetSceneFogDensityMultiplier);  // Caelum::CaelumSystem::FUNCTION void : setSceneFogDensityMultiplier : 1 params                
00335                         REGISTER_METHOD(GetSceneFogDensityMultiplier);  // Caelum::CaelumSystem::FUNCTION double : getSceneFogDensityMultiplier : 0 params              
00336                         REGISTER_METHOD(SetGroundFogDensityMultiplier); // Caelum::CaelumSystem::FUNCTION void : setGroundFogDensityMultiplier : 1 params               
00337                         REGISTER_METHOD(GetGroundFogDensityMultiplier); // Caelum::CaelumSystem::FUNCTION double : getGroundFogDensityMultiplier : 0 params             
00338                         REGISTER_METHOD(SetGlobalFogDensityMultiplier); // Caelum::CaelumSystem::FUNCTION void : setGlobalFogDensityMultiplier : 1 params               
00339                         REGISTER_METHOD(GetGlobalFogDensityMultiplier); // Caelum::CaelumSystem::FUNCTION double : getGlobalFogDensityMultiplier : 0 params             
00340                         REGISTER_METHOD(SetManageAmbientLight); // Caelum::CaelumSystem::FUNCTION void : setManageAmbientLight : 1 params               
00341                         REGISTER_METHOD(GetManageAmbientLight); // Caelum::CaelumSystem::FUNCTION bool : getManageAmbientLight : 0 params               
00342                         REGISTER_METHOD(SetMinimumAmbientLight);    // Caelum::CaelumSystem::FUNCTION void : setMinimumAmbientLight : 1 params              
00343                         REGISTER_METHOD(GetMinimumAmbientLight);    // Caelum::CaelumSystem::FUNCTION Ogre::ColourValue : getMinimumAmbientLight : 0 params             
00344                         REGISTER_METHOD(GetCloudSystem);
00345                         REGISTER_METHOD(GetCaelumCameraNode);
00346                         REGISTER_METHOD(GetCaelumGroundNode);
00347                         REGISTER_METHOD(SetUpdateTimeout);  // Caelum::CaelumSystem::FUNCTION void : setUpdateTimeout : 1 params                
00348                         REGISTER_METHOD(GetUpdateTimeout);  // Caelum::CaelumSystem::FUNCTION Ogre::Real : getUpdateTimeout : 0 params              
00349                         REGISTER_METHOD(SetAutoMoveCameraNode); // Caelum::CaelumSystem::FUNCTION void : setAutoMoveCameraNode : 1 params               
00350                         REGISTER_METHOD(GetAutoMoveCameraNode); // Caelum::CaelumSystem::FUNCTION Ogre::Real : getAutoMoveCameraNode : 0 params             
00351                         REGISTER_METHOD(NotifyCameraChanged);   // Caelum::CaelumSystem::FUNCTION Ogre::Real : getUpdateTimeout : 0 params              
00352             
00353                 REGISTER_METHOD(Destroy);    
00354                 
00355                 #undef REGISTER_METHOD
00356                 
00357                 #define RegisterClassConstant(name,constant) cScripting::SetGlobal(L,#name,constant)
00358                 RegisterClassConstant(CAELUM_COMPONENT_SKY_DOME, Caelum::CaelumSystem::CAELUM_COMPONENT_SKY_DOME);
00359                 RegisterClassConstant(CAELUM_COMPONENT_MOON, Caelum::CaelumSystem::CAELUM_COMPONENT_MOON);
00360                 RegisterClassConstant(CAELUM_COMPONENT_SUN, Caelum::CaelumSystem::CAELUM_COMPONENT_SUN);
00361                 RegisterClassConstant(CAELUM_COMPONENT_IMAGE_STARFIELD, Caelum::CaelumSystem::CAELUM_COMPONENT_IMAGE_STARFIELD);
00362                 RegisterClassConstant(CAELUM_COMPONENT_POINT_STARFIELD, Caelum::CaelumSystem::CAELUM_COMPONENT_POINT_STARFIELD);
00363                 RegisterClassConstant(CAELUM_COMPONENT_CLOUDS, Caelum::CaelumSystem::CAELUM_COMPONENT_CLOUDS);
00364                 RegisterClassConstant(CAELUM_COMPONENT_PRECIPITATION, Caelum::CaelumSystem::CAELUM_COMPONENT_PRECIPITATION);
00365                 RegisterClassConstant(CAELUM_COMPONENT_SCREEN_SPACE_FOG, Caelum::CaelumSystem::CAELUM_COMPONENT_SCREEN_SPACE_FOG);
00366                 RegisterClassConstant(CAELUM_COMPONENT_GROUND_FOG, Caelum::CaelumSystem::CAELUM_COMPONENT_GROUND_FOG);
00367 
00368                 RegisterClassConstant(CAELUM_COMPONENTS_NONE, Caelum::CaelumSystem::CAELUM_COMPONENTS_NONE);
00369                 RegisterClassConstant(CAELUM_COMPONENTS_DEFAULT, Caelum::CaelumSystem::CAELUM_COMPONENTS_DEFAULT);
00370                 RegisterClassConstant(CAELUM_COMPONENTS_ALL, Caelum::CaelumSystem::CAELUM_COMPONENTS_ALL);
00371                 #undef RegisterClassConstant
00372             }
00373             virtual const char* GetLuaTypeName () { return "lugre.caelum.caelumsystem"; }
00374 
00376                 static int  Destroy         (lua_State *L) { PROFILE
00377                     delete checkudata_alive(L);
00378                     return 0;
00379                 }
00380 
00382                 static int  CreateCaelumCaelumSystem            (lua_State *L) { PROFILE
00383                     unsigned int components = (unsigned int)Caelum::CaelumSystem::CAELUM_COMPONENTS_DEFAULT;
00384                     if(lua_gettop(L) >= 1 && !lua_isnil(L,1))components = luaL_checkint(L,1);
00385                     Caelum::CaelumSystem *p = new Caelum::CaelumSystem(
00386                         cOgreWrapper::GetSingleton().mRoot,
00387                         cOgreWrapper::GetSingleton().mSceneMgr, 
00388                         (Caelum::CaelumSystem::CaelumComponent)components
00389                     );
00390                     
00391                     // Register caelum as a listener.
00392                     cOgreWrapper::GetSingleton().mWindow->addListener (p);
00393                     cOgreWrapper::GetSingleton().mRoot->addFrameListener (p);
00394                     
00395                     return CreateUDataOrNil(L,p);
00396                 }
00397                 
00398             
00400             static int  Shutdown    (lua_State *L) { PROFILE
00401                 // int argc = lua_gettop(L);
00402                 bool p0 = luaL_checkbool(L, 2);
00403                 
00404                 checkudata_alive(L)->shutdown(p0);
00405                 
00406                 return 0;
00407             }
00408 
00410             static int  GetUniversalClock   (lua_State *L) { PROFILE
00411                 // int argc = lua_gettop(L);
00412                 
00413                 Caelum::UniversalClock *r = checkudata_alive(L)->getUniversalClock();
00414                 
00415                 return cLuaBind<Caelum::UniversalClock>::CreateUData(L,r);
00416             }
00417 
00419             static int  UpdateSubcomponents (lua_State *L) { PROFILE
00420                 // int argc = lua_gettop(L);
00421                 double p0 = luaL_checknumber(L, 2);
00422                 
00423                 checkudata_alive(L)->updateSubcomponents(p0);
00424                 
00425                 return 0;
00426             }
00427 
00429             static int  SetSkyDome  (lua_State *L) { PROFILE
00430                 // int argc = lua_gettop(L);
00431                 Caelum::SkyDome *p0 = cLuaBind<Caelum::SkyDome>::checkudata_alive(L, 2);
00432                 
00433                 checkudata_alive(L)->setSkyDome(p0);
00434                 
00435                 return 0;
00436             }
00437 
00439             static int  SetUpdateTimeout    (lua_State *L) { PROFILE
00440                 // int argc = lua_gettop(L);
00441                 Ogre::Real p0 = luaL_checknumber(L, 2);
00442                 
00443                 checkudata_alive(L)->setUpdateTimeout(p0);
00444                 
00445                 return 0;
00446             }
00447 
00449             static int  GetUpdateTimeout    (lua_State *L) { PROFILE
00450                 // int argc = lua_gettop(L);
00451                 
00452                 Ogre::Real r = checkudata_alive(L)->getUpdateTimeout();
00453                 
00454                 lua_pushnumber(L, r);
00455                 return 1;
00456             }
00457 
00459             static int  SetAutoMoveCameraNode   (lua_State *L) { PROFILE
00460                 // int argc = lua_gettop(L);
00461                 bool p0 = luaL_checkbool(L, 2);
00462                 
00463                 checkudata_alive(L)->setAutoMoveCameraNode(p0);
00464                 
00465                 return 0;
00466             }
00467 
00469             static int  GetAutoMoveCameraNode   (lua_State *L) { PROFILE
00470                 // int argc = lua_gettop(L);
00471                 
00472                 bool r = checkudata_alive(L)->getAutoMoveCameraNode();
00473                 
00474                 lua_pushboolean(L, r);
00475                 return 1;
00476             }           
00477 
00479             static int  NotifyCameraChanged (lua_State *L) { PROFILE
00480                 // int argc = lua_gettop(L);
00481                 cCamera *c = cLuaBind<cCamera>::checkudata_alive(L,2);
00482                 
00483                 checkudata_alive(L)->notifyCameraChanged(c->mpCam);
00484                 
00485                 return 0;
00486             }   
00487 
00489             static int  GetSkyDome  (lua_State *L) { PROFILE
00490                 // int argc = lua_gettop(L);
00491                 
00492                 Caelum::SkyDome *r = checkudata_alive(L)->getSkyDome();
00493                 
00494                 return cLuaBind<Caelum::SkyDome>::CreateUData(L,r);
00495             }
00496 
00498             static int  SetSun  (lua_State *L) { PROFILE
00499                 // int argc = lua_gettop(L);
00500                 Caelum::BaseSkyLight* p0 = cLuaBind<Caelum::BaseSkyLight>::checkudata_alive(L, 2);
00501                 
00502                 checkudata_alive(L)->setSun(p0);
00503                 
00504                 return 0;
00505             }
00506 
00508             static int  GetSun  (lua_State *L) { PROFILE
00509                 // int argc = lua_gettop(L);
00510                 
00511                 Caelum::BaseSkyLight* r = checkudata_alive(L)->getSun();
00512                 
00513                 return cLuaBind<Caelum::BaseSkyLight>::CreateUData(L,r);
00514             }
00515 
00517             static int  GetPrecipitationController  (lua_State *L) { PROFILE
00518                 // int argc = lua_gettop(L);
00519                 
00520                 Caelum::PrecipitationController* r = checkudata_alive(L)->getPrecipitationController();
00521                 
00522                 return cLuaBind<Caelum::PrecipitationController>::CreateUData(L,r);
00523             }
00524 
00526             static int  GetCloudSystem  (lua_State *L) { PROFILE
00527                 // int argc = lua_gettop(L);
00528                 
00529                 Caelum::CloudSystem* r = checkudata_alive(L)->getCloudSystem();
00530                 
00531                 return cLuaBind<Caelum::CloudSystem>::CreateUData(L,r);
00532             }
00533 
00534 
00536             static int  GetCaelumCameraNode (lua_State *L) { PROFILE
00537                 // int argc = lua_gettop(L);
00538                 
00539                 cGfx3D* r = cGfx3D::NewOfSceneNode(checkudata_alive(L)->getCaelumCameraNode());
00540     
00541                 return cLuaBind<cGfx3D>::CreateUData(L,r);
00542             }
00543             
00545             static int  GetCaelumGroundNode (lua_State *L) { PROFILE
00546                 // int argc = lua_gettop(L);
00547                 
00548                 cGfx3D* r = cGfx3D::NewOfSceneNode(checkudata_alive(L)->getCaelumGroundNode());
00549     
00550                 return cLuaBind<cGfx3D>::CreateUData(L,r);
00551             }
00552 
00554             static int  SetMoon (lua_State *L) { PROFILE
00555                 // int argc = lua_gettop(L);
00556                 Caelum::Moon* p0 = cLuaBind<Caelum::Moon>::checkudata_alive(L, 2);
00557                 
00558                 checkudata_alive(L)->setMoon(p0);
00559                 
00560                 return 0;
00561             }
00562 
00564             static int  GetMoon (lua_State *L) { PROFILE
00565                 // int argc = lua_gettop(L);
00566                 
00567                 Caelum::BaseSkyLight* r = checkudata_alive(L)->getMoon();
00568                 
00569                 return cLuaBind<Caelum::BaseSkyLight>::CreateUData(L,r);
00570             }
00571 
00573             static int  SetGroundFog    (lua_State *L) { PROFILE
00574                 // int argc = lua_gettop(L);
00575                 Caelum::GroundFog *p0 =  cLuaBind<Caelum::GroundFog>::checkudata_alive(L, 2);
00576                 
00577                 checkudata_alive(L)->setGroundFog(p0);
00578                 
00579                 return 0;
00580             }
00581 
00583             static int  GetGroundFog    (lua_State *L) { PROFILE
00584                 // int argc = lua_gettop(L);
00585                 
00586                 Caelum::GroundFog* r = checkudata_alive(L)->getGroundFog();
00587                 
00588                 return cLuaBind<Caelum::GroundFog>::CreateUData(L,r);
00589             }
00590 
00592             static int  SetManageSceneFog   (lua_State *L) { PROFILE
00593                 // int argc = lua_gettop(L);
00594                 bool p0 = luaL_checkbool(L, 2);
00595                 
00596                 checkudata_alive(L)->setManageSceneFog(p0);
00597                 
00598                 return 0;
00599             }
00600 
00602             static int  GetManageSceneFog   (lua_State *L) { PROFILE
00603                 // int argc = lua_gettop(L);
00604                 
00605                 bool r = checkudata_alive(L)->getManageSceneFog();
00606                 
00607                 lua_pushboolean(L, r);
00608                 return 1;
00609             }
00610 
00612             static int  SetSceneFogDensityMultiplier    (lua_State *L) { PROFILE
00613                 // int argc = lua_gettop(L);
00614                 double p0 = luaL_checknumber(L, 2);
00615                 
00616                 checkudata_alive(L)->setSceneFogDensityMultiplier(p0);
00617                 
00618                 return 0;
00619             }
00620 
00622             static int  GetSceneFogDensityMultiplier    (lua_State *L) { PROFILE
00623                 // int argc = lua_gettop(L);
00624                 
00625                 double r = checkudata_alive(L)->getSceneFogDensityMultiplier();
00626                 
00627                 lua_pushnumber(L, r);
00628                 return 1;
00629             }
00630 
00632             static int  SetGroundFogDensityMultiplier   (lua_State *L) { PROFILE
00633                 // int argc = lua_gettop(L);
00634                 double p0 = luaL_checknumber(L, 2);
00635                 
00636                 checkudata_alive(L)->setGroundFogDensityMultiplier(p0);
00637                 
00638                 return 0;
00639             }
00640 
00642             static int  GetGroundFogDensityMultiplier   (lua_State *L) { PROFILE
00643                 // int argc = lua_gettop(L);
00644                 
00645                 double r = checkudata_alive(L)->getGroundFogDensityMultiplier();
00646                 
00647                 lua_pushnumber(L, r);
00648                 return 1;
00649             }
00650 
00652             static int  SetGlobalFogDensityMultiplier   (lua_State *L) { PROFILE
00653                 // int argc = lua_gettop(L);
00654                 double p0 = luaL_checknumber(L, 2);
00655                 
00656                 checkudata_alive(L)->setGlobalFogDensityMultiplier(p0);
00657                 
00658                 return 0;
00659             }
00660 
00662             static int  GetGlobalFogDensityMultiplier   (lua_State *L) { PROFILE
00663                 // int argc = lua_gettop(L);
00664                 
00665                 double r = checkudata_alive(L)->getGlobalFogDensityMultiplier();
00666                 
00667                 lua_pushnumber(L, r);
00668                 return 1;
00669             }
00670 
00672             static int  SetManageAmbientLight   (lua_State *L) { PROFILE
00673                 // int argc = lua_gettop(L);
00674                 bool p0 = luaL_checkbool(L, 2);
00675                 
00676                 checkudata_alive(L)->setManageAmbientLight(p0);
00677                 
00678                 return 0;
00679             }
00680 
00682             static int  GetManageAmbientLight   (lua_State *L) { PROFILE
00683                 // int argc = lua_gettop(L);
00684                 
00685                 bool r = checkudata_alive(L)->getManageAmbientLight();
00686                 
00687                 lua_pushboolean(L, r);
00688                 return 1;
00689             }
00690 
00692             static int  SetMinimumAmbientLight  (lua_State *L) { PROFILE
00693                 // int argc = lua_gettop(L);
00694                 Ogre::ColourValue p0;
00695                 CHECK_COLOURVALUE(p0,2);
00696                 
00697                 checkudata_alive(L)->setMinimumAmbientLight(p0);
00698                 
00699                 return 0;
00700             }
00701 
00703             static int  GetMinimumAmbientLight  (lua_State *L) { PROFILE
00704                 // int argc = lua_gettop(L);
00705                 
00706                 Ogre::ColourValue r = checkudata_alive(L)->getMinimumAmbientLight();
00707                 
00708                 PUSH_COLOURVALUE(r);
00709                 return 4;
00710             }
00711     
00712 
00713         };
00714         
00715             // Caelum::CLASS GroundFog
00716 
00717         class cCaelumGroundFog_L : public cLuaBind<Caelum::GroundFog> { public:
00718             virtual void RegisterMethods    (lua_State *L) { PROFILE
00719                 //lua_register(L,"CreateCaelumGroundFog",    &cCaelumGroundFog_L::CreateCaelumGroundFog);
00720             
00721                 #define REGISTER_METHOD(methodname) mlMethod.push_back(make_luaL_reg(#methodname,&cCaelumGroundFog_L::methodname));     
00722                 
00723                         //REGISTER_METHOD(GetPasses);   // Caelum::GroundFog::FUNCTION PassSet& : getPasses : 0 params              
00724                         //REGISTER_METHOD(GetPasses);   // Caelum::GroundFog::FUNCTION PassSet& : getPasses : 0 params              
00725                         //REGISTER_METHOD(FindFogPassesByName); // Caelum::GroundFog::FUNCTION void : findFogPassesByName : 1 params                
00726                         REGISTER_METHOD(SetDensity);    // Caelum::GroundFog::FUNCTION void : setDensity : 1 params             
00727                         REGISTER_METHOD(GetDensity);    // Caelum::GroundFog::FUNCTION Ogre::Real : getDensity : 0 params               
00728                         REGISTER_METHOD(SetColour); // Caelum::GroundFog::FUNCTION void : setColour : 1 params              
00729                         REGISTER_METHOD(GetColour); // Caelum::GroundFog::FUNCTION Ogre::ColourValue : getColour : 0 params             
00730                         REGISTER_METHOD(SetVerticalDecay);  // Caelum::GroundFog::FUNCTION void : setVerticalDecay : 1 params               
00731                         REGISTER_METHOD(GetVerticalDecay);  // Caelum::GroundFog::FUNCTION Ogre::Real : getVerticalDecay : 0 params             
00732                         REGISTER_METHOD(SetGroundLevel);    // Caelum::GroundFog::FUNCTION void : setGroundLevel : 1 params             
00733                         REGISTER_METHOD(GetGroundLevel);    // Caelum::GroundFog::FUNCTION Ogre::Real : getGroundLevel : 0 params               
00734                         REGISTER_METHOD(ForceUpdate);   // Caelum::GroundFog::FUNCTION void : forceUpdate : 0 params                
00735                         //REGISTER_METHOD(NotifyCameraChanged); // Caelum::GroundFog::FUNCTION void : notifyCameraChanged : 1 params                
00736         // NAMESPACE caelum
00737             
00738                 REGISTER_METHOD(Destroy);    
00739                 
00740                 #undef REGISTER_METHOD
00741             }
00742             virtual const char* GetLuaTypeName () { return "lugre.caelum.GroundFog"; }
00743 
00745                 static int  Destroy         (lua_State *L) { PROFILE
00746                     delete checkudata_alive(L);
00747                     return 0;
00748                 }
00749                 
00751             static int  SetDensity  (lua_State *L) { PROFILE
00752                 // int argc = lua_gettop(L);
00753                 Ogre::Real p0 = luaL_checknumber(L, 2);
00754                 
00755                 checkudata_alive(L)->setDensity(p0);
00756                 
00757                 return 0;
00758             }
00759 
00761             static int  GetDensity  (lua_State *L) { PROFILE
00762                 // int argc = lua_gettop(L);
00763                 
00764                 Ogre::Real r = checkudata_alive(L)->getDensity();
00765                 
00766                 lua_pushnumber(L, r);
00767                 return 1;
00768             }
00769 
00771             static int  SetColour   (lua_State *L) { PROFILE
00772                 // int argc = lua_gettop(L);
00773                 Ogre::ColourValue p0;
00774                 CHECK_COLOURVALUE(p0, 2);
00775                 
00776                 checkudata_alive(L)->setColour(p0);
00777                 
00778                 return 0;
00779             }
00780 
00782             static int  GetColour   (lua_State *L) { PROFILE
00783                 // int argc = lua_gettop(L);
00784                 
00785                 Ogre::ColourValue r = checkudata_alive(L)->getColour();
00786                 
00787                 PUSH_COLOURVALUE(r);
00788                 return 4;
00789             }
00790 
00792             static int  SetVerticalDecay    (lua_State *L) { PROFILE
00793                 // int argc = lua_gettop(L);
00794                 Ogre::Real p0 = luaL_checknumber(L, 2);
00795                 
00796                 checkudata_alive(L)->setVerticalDecay(p0);
00797                 
00798                 return 0;
00799             }
00800 
00802             static int  GetVerticalDecay    (lua_State *L) { PROFILE
00803                 // int argc = lua_gettop(L);
00804                 
00805                 Ogre::Real r = checkudata_alive(L)->getVerticalDecay();
00806                 
00807                 lua_pushnumber(L, r);
00808                 return 1;
00809             }
00810 
00812             static int  SetGroundLevel  (lua_State *L) { PROFILE
00813                 // int argc = lua_gettop(L);
00814                 Ogre::Real p0 = luaL_checknumber(L, 2);
00815                 
00816                 checkudata_alive(L)->setGroundLevel(p0);
00817                 
00818                 return 0;
00819             }
00820 
00822             static int  GetGroundLevel  (lua_State *L) { PROFILE
00823                 // int argc = lua_gettop(L);
00824                 
00825                 Ogre::Real r = checkudata_alive(L)->getGroundLevel();
00826                 
00827                 lua_pushnumber(L, r);
00828                 return 1;
00829             }
00830 
00832             static int  ForceUpdate (lua_State *L) { PROFILE
00833                 // int argc = lua_gettop(L);
00834                 
00835                 checkudata_alive(L)->forceUpdate();
00836                 
00837                 return 0;
00838             }
00839         };
00840         
00841         
00842             // Caelum::CLASS Moon
00843 
00844         class cCaelumMoon_L : public cLuaBind<Caelum::Moon> { public:
00845             virtual void RegisterMethods    (lua_State *L) { PROFILE
00846                 //lua_register(L,"CreateCaelumMoon",    &cCaelumMoon_L::CreateCaelumMoon);
00847             
00848                 #define REGISTER_METHOD(methodname) mlMethod.push_back(make_luaL_reg(#methodname,&cCaelumMoon_L::methodname));      
00849                 
00850                         REGISTER_METHOD(SetMoonTexture);    // Caelum::Moon::FUNCTION void : setMoonTexture : 1 params              
00851                         REGISTER_METHOD(SetMoonTextureAngularSize); // Caelum::Moon::FUNCTION void : setMoonTextureAngularSize : 1 params               
00852                         REGISTER_METHOD(SetBodyColour); // Caelum::Moon::FUNCTION void : setBodyColour : 1 params               
00853                         REGISTER_METHOD(SetPhase);  // Caelum::Moon::FUNCTION void : setPhase : 1 params                
00854                         //REGISTER_METHOD(NotifyCameraChanged); // Caelum::Moon::FUNCTION void : notifyCameraChanged : 1 params             
00855         // NAMESPACE caelum
00856             
00857                 REGISTER_METHOD(Destroy);    
00858                 
00859                 #undef REGISTER_METHOD
00860             }
00861             virtual const char* GetLuaTypeName () { return "lugre.caelum.moon"; }
00862 
00864                 static int  Destroy         (lua_State *L) { PROFILE
00865                     delete checkudata_alive(L);
00866                     return 0;
00867                 }
00868                 
00869             
00871             static int  SetMoonTexture  (lua_State *L) { PROFILE
00872                 // int argc = lua_gettop(L);
00873                 Ogre::String p0 = luaL_checkstring(L, 2);
00874                 
00875                 checkudata_alive(L)->setMoonTexture(p0);
00876                 
00877                 return 0;
00878             }
00879 
00881             static int  SetMoonTextureAngularSize   (lua_State *L) { PROFILE
00882                 // int argc = lua_gettop(L);
00883                 Ogre::Degree p0((Ogre::Real)luaL_checknumber(L, 2));
00884                 
00885                 checkudata_alive(L)->setMoonTextureAngularSize(p0);
00886                 
00887                 return 0;
00888             }
00889 
00891             static int  SetBodyColour   (lua_State *L) { PROFILE
00892                 // int argc = lua_gettop(L);
00893                 Ogre::ColourValue p0;
00894                 CHECK_COLOURVALUE(p0,2);
00895                 
00896                 checkudata_alive(L)->setBodyColour(p0);
00897                 
00898                 return 0;
00899             }
00900 
00902             static int  SetPhase    (lua_State *L) { PROFILE
00903                 // int argc = lua_gettop(L);
00904                 Ogre::Real p0 = luaL_checknumber(L, 2);
00905                 
00906                 checkudata_alive(L)->setPhase(p0);
00907                 
00908                 return 0;
00909             }
00910 
00911         };
00912 
00913         
00914             // Caelum::CLASS SkyDome
00915 
00916         class cCaelumSkyDome_L : public cLuaBind<Caelum::SkyDome> { public:
00917             virtual void RegisterMethods    (lua_State *L) { PROFILE
00918                 //lua_register(L,"CreateCaelumSkyDome",    &cCaelumSkyDome_L::CreateCaelumSkyDome);
00919             
00920                 #define REGISTER_METHOD(methodname) mlMethod.push_back(make_luaL_reg(#methodname,&cCaelumSkyDome_L::methodname));       
00921                 
00922                         REGISTER_METHOD(SetSunDirection);   // Caelum::SkyDome::FUNCTION void : setSunDirection : 1 params              
00923                         REGISTER_METHOD(SetHazeColour); // Caelum::SkyDome::FUNCTION void : setHazeColour : 1 params                
00924                         //~ REGISTER_METHOD(SetLightAbsorption);    // Caelum::SkyDome::FUNCTION void : setLightAbsorption : 1 params               
00925                         //~ REGISTER_METHOD(SetLightScattering);    // Caelum::SkyDome::FUNCTION void : setLightScattering : 1 params               
00926                         //~ REGISTER_METHOD(SetAtmosphereHeight);   // Caelum::SkyDome::FUNCTION void : setAtmosphereHeight : 1 params              
00927                         REGISTER_METHOD(SetSkyGradientsImage);  // Caelum::SkyDome::FUNCTION void : setSkyGradientsImage : 1 params             
00928                         REGISTER_METHOD(SetAtmosphereDepthImage);   // Caelum::SkyDome::FUNCTION void : setAtmosphereDepthImage : 1 params              
00929                         REGISTER_METHOD(GetHazeEnabled);    // Caelum::SkyDome::FUNCTION bool : getHazeEnabled : 0 params               
00930                         REGISTER_METHOD(SetHazeEnabled);    // Caelum::SkyDome::FUNCTION void : setHazeEnabled : 1 params               
00931                         //REGISTER_METHOD(NotifyCameraChanged); // Caelum::SkyDome::FUNCTION void : notifyCameraChanged : 1 params              
00932         // NAMESPACE caelum
00933             
00934                 REGISTER_METHOD(Destroy);    
00935                 
00936                 #undef REGISTER_METHOD
00937             }
00938             virtual const char* GetLuaTypeName () { return "lugre.caelum.skydome"; }
00939 
00941                 static int  Destroy         (lua_State *L) { PROFILE
00942                     delete checkudata_alive(L);
00943                     return 0;
00944                 }
00945                 
00946             
00948             static int  SetSunDirection (lua_State *L) { PROFILE
00949                 // int argc = lua_gettop(L);
00950                 Ogre::Vector3 p0;
00951                 CHECK_VECTOR3(p0,2);
00952                 
00953                 checkudata_alive(L)->setSunDirection(p0);
00954                 
00955                 return 0;
00956             }
00957 
00959             static int  SetHazeColour   (lua_State *L) { PROFILE
00960                 // int argc = lua_gettop(L);
00961                 Ogre::ColourValue p0;
00962                 CHECK_COLOURVALUE(p0,2);
00963                 
00964                 checkudata_alive(L)->setHazeColour(p0);
00965                 
00966                 return 0;
00967             }
00968 
00969             //~ /// lua :  SkyDome:SetLightAbsorption(number absorption)
00970             //~ static int  SetLightAbsorption  (lua_State *L) { PROFILE
00971                 //~ // int argc = lua_gettop(L);
00972                 //~ float p0 = luaL_checknumber(L, 2);
00973                 //~ 
00974                 //~ checkudata_alive(L)->setLightAbsorption(p0);
00975                 //~ 
00976                 //~ return 0;
00977             //~ }
00978 
00979             //~ /// lua :  SkyDome:SetLightScattering(number scattering)
00980             //~ static int  SetLightScattering  (lua_State *L) { PROFILE
00981                 //~ // int argc = lua_gettop(L);
00982                 //~ float p0 = luaL_checknumber(L, 2);
00983                 //~ 
00984                 //~ checkudata_alive(L)->setLightScattering(p0);
00985                 //~ 
00986                 //~ return 0;
00987             //~ }
00988 
00989             //~ /// lua :  SkyDome:SetAtmosphereHeight(number height)
00990             //~ static int  SetAtmosphereHeight (lua_State *L) { PROFILE
00991                 //~ // int argc = lua_gettop(L);
00992                 //~ float p0 = luaL_checknumber(L, 2);
00993                 //~ 
00994                 //~ checkudata_alive(L)->setAtmosphereHeight(p0);
00995                 //~ 
00996                 //~ return 0;
00997             //~ }
00998 
01000             static int  SetSkyGradientsImage    (lua_State *L) { PROFILE
01001                 // int argc = lua_gettop(L);
01002                 Ogre::String p0 = luaL_checkstring(L, 2);
01003                 
01004                 checkudata_alive(L)->setSkyGradientsImage(p0);
01005                 
01006                 return 0;
01007             }
01008 
01010             static int  SetAtmosphereDepthImage (lua_State *L) { PROFILE
01011                 // int argc = lua_gettop(L);
01012                 Ogre::String p0 = luaL_checkstring(L, 2);
01013                 
01014                 checkudata_alive(L)->setAtmosphereDepthImage(p0);
01015                 
01016                 return 0;
01017             }
01018 
01020             static int  GetHazeEnabled  (lua_State *L) { PROFILE
01021                 // int argc = lua_gettop(L);
01022                 
01023                 bool r = checkudata_alive(L)->getHazeEnabled();
01024                 
01025                 lua_pushboolean(L, r);
01026                 return 1;
01027             }
01028 
01030             static int  SetHazeEnabled  (lua_State *L) { PROFILE
01031                 // int argc = lua_gettop(L);
01032                 bool p0 = luaL_checkbool(L, 2);
01033                 
01034                 checkudata_alive(L)->setHazeEnabled(p0);
01035                 
01036                 return 0;
01037             }
01038 
01039         };
01040         
01041             // Caelum::CLASS BaseSkyLight
01042 
01043         class cCaelumBaseSkyLight_L : public cLuaBind<Caelum::BaseSkyLight> { public:
01044             virtual void RegisterMethods    (lua_State *L) { PROFILE
01045                 //lua_register(L,"CreateCaelumBaseSkyLight",    &cCaelumBaseSkyLight_L::CreateCaelumBaseSkyLight);
01046             
01047                 #define REGISTER_METHOD(methodname) mlMethod.push_back(make_luaL_reg(#methodname,&cCaelumBaseSkyLight_L::methodname));      
01048                 
01049                         REGISTER_METHOD(Update);    // Caelum::BaseSkyLight::FUNCTION void : update : 3 params              
01050                         REGISTER_METHOD(GetLightDirection); // Caelum::BaseSkyLight::FUNCTION Ogre::Vector3& : getLightDirection : 0 params             
01051                         REGISTER_METHOD(SetLightDirection); // Caelum::BaseSkyLight::FUNCTION void : setLightDirection : 1 params               
01052                         REGISTER_METHOD(GetBodyColour); // Caelum::BaseSkyLight::FUNCTION Ogre::ColourValue : getBodyColour : 0 params              
01053                         REGISTER_METHOD(SetBodyColour); // Caelum::BaseSkyLight::FUNCTION void : setBodyColour : 1 params               
01054                         REGISTER_METHOD(GetLightColour);    // Caelum::BaseSkyLight::FUNCTION Ogre::ColourValue : getLightColour : 0 params             
01055                         REGISTER_METHOD(SetLightColour);    // Caelum::BaseSkyLight::FUNCTION void : setLightColour : 1 params              
01056                         REGISTER_METHOD(SetDiffuseMultiplier);  // Caelum::BaseSkyLight::FUNCTION void : setDiffuseMultiplier : 1 params                
01057                         REGISTER_METHOD(GetDiffuseMultiplier);  // Caelum::BaseSkyLight::FUNCTION Ogre::ColourValue : getDiffuseMultiplier : 0 params               
01058                         REGISTER_METHOD(SetSpecularMultiplier); // Caelum::BaseSkyLight::FUNCTION void : setSpecularMultiplier : 1 params               
01059                         REGISTER_METHOD(GetSpecularMultiplier); // Caelum::BaseSkyLight::FUNCTION Ogre::ColourValue : getSpecularMultiplier : 0 params              
01060                         REGISTER_METHOD(SetAmbientMultiplier);  // Caelum::BaseSkyLight::FUNCTION void : setAmbientMultiplier : 1 params                
01061                         REGISTER_METHOD(GetAmbientMultiplier);  // Caelum::BaseSkyLight::FUNCTION Ogre::ColourValue : getAmbientMultiplier : 0 params               
01062                         REGISTER_METHOD(GetMainLight);  // Caelum::BaseSkyLight::FUNCTION Ogre::Light* : getMainLight : 0 params                
01063                         REGISTER_METHOD(GetAutoDisable);    // Caelum::BaseSkyLight::FUNCTION bool : getAutoDisable : 0 params              
01064                         REGISTER_METHOD(SetAutoDisable);    // Caelum::BaseSkyLight::FUNCTION void : setAutoDisable : 1 params              
01065                         REGISTER_METHOD(GetAutoDisableThreshold);   // Caelum::BaseSkyLight::FUNCTION Ogre::Real : getAutoDisableThreshold : 0 params               
01066                         REGISTER_METHOD(SetAutoDisableThreshold);   // Caelum::BaseSkyLight::FUNCTION void : setAutoDisableThreshold : 1 params             
01067                         REGISTER_METHOD(SetForceDisable);   // Caelum::BaseSkyLight::FUNCTION void : setForceDisable : 1 params             
01068                         REGISTER_METHOD(GetForceDisable);   // Caelum::BaseSkyLight::FUNCTION bool : getForceDisable : 0 params             
01069         // NAMESPACE caelum
01070             
01071                 REGISTER_METHOD(Destroy);    
01072                 
01073                 #undef REGISTER_METHOD
01074             }
01075             virtual const char* GetLuaTypeName () { return "lugre.caelum.baseskylight"; }
01076 
01078                 static int  Destroy         (lua_State *L) { PROFILE
01079                     delete checkudata_alive(L);
01080                     return 0;
01081                 }
01082                 
01083             
01085             static int  Update  (lua_State *L) { PROFILE
01086                 // int argc = lua_gettop(L);
01087                 Ogre::Vector3 p0;
01088                 CHECK_VECTOR3(p0,2);
01089                 Ogre::ColourValue p1;
01090                 CHECK_COLOURVALUE(p1,5);
01091                 Ogre::ColourValue p2;
01092                 CHECK_COLOURVALUE(p2,0);
01093                 
01094                 checkudata_alive(L)->update(p0, p1, p2);
01095                 
01096                 return 0;
01097             }
01098 
01100             static int  GetLightDirection   (lua_State *L) { PROFILE
01101                 // int argc = lua_gettop(L);
01102                 
01103                 Ogre::Vector3 r = checkudata_alive(L)->getLightDirection();
01104                 
01105                 PUSH_VECTOR3(r);
01106                 return 3;
01107             }
01108 
01110             static int  SetLightDirection   (lua_State *L) { PROFILE
01111                 // int argc = lua_gettop(L);
01112                 Ogre::Vector3 p0;
01113                 CHECK_VECTOR3(p0,2);
01114                 
01115                 checkudata_alive(L)->setLightDirection(p0);
01116                 
01117                 return 0;
01118             }
01119 
01121             static int  GetBodyColour   (lua_State *L) { PROFILE
01122                 // int argc = lua_gettop(L);
01123                 
01124                 Ogre::ColourValue r = checkudata_alive(L)->getBodyColour();
01125                 
01126                 PUSH_COLOURVALUE(r);
01127                 return 4;
01128             }
01129 
01131             static int  SetBodyColour   (lua_State *L) { PROFILE
01132                 // int argc = lua_gettop(L);
01133                 Ogre::ColourValue p0;
01134                 CHECK_COLOURVALUE(p0,2);
01135                 
01136                 checkudata_alive(L)->setBodyColour(p0);
01137                 
01138                 return 0;
01139             }
01140 
01142             static int  GetLightColour  (lua_State *L) { PROFILE
01143                 // int argc = lua_gettop(L);
01144                 
01145                 Ogre::ColourValue r = checkudata_alive(L)->getLightColour();
01146                 
01147                 PUSH_COLOURVALUE(r);
01148                 return 4;
01149             }
01150 
01152             static int  SetLightColour  (lua_State *L) { PROFILE
01153                 // int argc = lua_gettop(L);
01154                 Ogre::ColourValue p0;
01155                 CHECK_COLOURVALUE(p0,2);
01156                 
01157                 checkudata_alive(L)->setLightColour(p0);
01158                 
01159                 return 0;
01160             }
01161 
01163             static int  SetDiffuseMultiplier    (lua_State *L) { PROFILE
01164                 // int argc = lua_gettop(L);
01165                 Ogre::ColourValue p0;
01166                 CHECK_COLOURVALUE(p0,2);
01167                 
01168                 checkudata_alive(L)->setDiffuseMultiplier(p0);
01169                 
01170                 return 0;
01171             }
01172 
01174             static int  GetDiffuseMultiplier    (lua_State *L) { PROFILE
01175                 // int argc = lua_gettop(L);
01176                 
01177                 Ogre::ColourValue r = checkudata_alive(L)->getDiffuseMultiplier();
01178                 
01179                 PUSH_COLOURVALUE(r);
01180                 return 4;
01181             }
01182 
01184             static int  SetSpecularMultiplier   (lua_State *L) { PROFILE
01185                 // int argc = lua_gettop(L);
01186                 Ogre::ColourValue p0;
01187                 CHECK_COLOURVALUE(p0,2);
01188                 
01189                 checkudata_alive(L)->setSpecularMultiplier(p0);
01190                 
01191                 return 0;
01192             }
01193 
01195             static int  GetSpecularMultiplier   (lua_State *L) { PROFILE
01196                 // int argc = lua_gettop(L);
01197                 
01198                 Ogre::ColourValue r = checkudata_alive(L)->getSpecularMultiplier();
01199                 
01200                 PUSH_COLOURVALUE(r);
01201                 return 4;
01202             }
01203 
01205             static int  SetAmbientMultiplier    (lua_State *L) { PROFILE
01206                 // int argc = lua_gettop(L);
01207                 Ogre::ColourValue p0;
01208                 CHECK_COLOURVALUE(p0,2);
01209                 
01210                 checkudata_alive(L)->setAmbientMultiplier(p0);
01211                 
01212                 return 0;
01213             }
01214 
01216             static int  GetAmbientMultiplier    (lua_State *L) { PROFILE
01217                 // int argc = lua_gettop(L);
01218                 
01219                 Ogre::ColourValue r = checkudata_alive(L)->getAmbientMultiplier();
01220                 
01221                 PUSH_COLOURVALUE(r);
01222                 return 4;
01223             }
01224 
01226             static int  GetMainLight    (lua_State *L) { PROFILE
01227                 // int argc = lua_gettop(L);
01228                 
01229                 Ogre::Light* r = checkudata_alive(L)->getMainLight();
01230                 
01231                 lua_pushstring(L, r->getName().c_str());
01232                 return 1;
01233             }
01234             
01236             static int  GetAutoDisable  (lua_State *L) { PROFILE
01237                 // int argc = lua_gettop(L);
01238                 
01239                 bool r = checkudata_alive(L)->getAutoDisable();
01240                 
01241                 lua_pushboolean(L, r);
01242                 return 1;
01243             }
01244 
01246             static int  SetAutoDisable  (lua_State *L) { PROFILE
01247                 // int argc = lua_gettop(L);
01248                 bool p0 = luaL_checkbool(L, 2);
01249                 
01250                 checkudata_alive(L)->setAutoDisable(p0);
01251                 
01252                 return 0;
01253             }
01254 
01256             static int  GetAutoDisableThreshold (lua_State *L) { PROFILE
01257                 // int argc = lua_gettop(L);
01258                 
01259                 Ogre::Real r = checkudata_alive(L)->getAutoDisableThreshold();
01260                 
01261                 lua_pushnumber(L, r);
01262                 return 1;
01263             }
01264 
01266             static int  SetAutoDisableThreshold (lua_State *L) { PROFILE
01267                 // int argc = lua_gettop(L);
01268                 Ogre::Real p0 = luaL_checknumber(L, 2);
01269                 
01270                 checkudata_alive(L)->setAutoDisableThreshold(p0);
01271                 
01272                 return 0;
01273             }
01274 
01276             static int  SetForceDisable (lua_State *L) { PROFILE
01277                 // int argc = lua_gettop(L);
01278                 bool p0 = luaL_checkbool(L, 2);
01279                 
01280                 checkudata_alive(L)->setForceDisable(p0);
01281                 
01282                 return 0;
01283             }
01284 
01286             static int  GetForceDisable (lua_State *L) { PROFILE
01287                 // int argc = lua_gettop(L);
01288                 
01289                 bool r = checkudata_alive(L)->getForceDisable();
01290                 
01291                 lua_pushboolean(L, r);
01292                 return 1;
01293             }
01294     
01295 
01296         };
01297         
01298             // Caelum::CLASS SphereSun
01299 
01300         class cCaelumSphereSun_L : public cLuaBind<Caelum::SphereSun> { public:
01301             virtual void RegisterMethods    (lua_State *L) { PROFILE
01302                 // lua_register(L,"CreateCaelumSphereSun",    &cCaelumSphereSun_L::CreateCaelumSphereSun);
01303             
01304                 #define REGISTER_METHOD(methodname) mlMethod.push_back(make_luaL_reg(#methodname,&cCaelumSphereSun_L::methodname));     
01305                 
01306                         REGISTER_METHOD(SetBodyColour); // Caelum::SphereSun::FUNCTION void : setBodyColour : 1 params              
01307                         //REGISTER_METHOD(NotifyCameraChanged); // Caelum::SphereSun::FUNCTION void : notifyCameraChanged : 1 params                
01308                     
01309                 REGISTER_METHOD(Destroy);    
01310                 
01311                 #undef REGISTER_METHOD
01312             }
01313             virtual const char* GetLuaTypeName () { return "lugre.caelum.spheresun"; }
01314 
01316                 static int  Destroy         (lua_State *L) { PROFILE
01317                     delete checkudata_alive(L);
01318                     return 0;
01319                 }
01320                             
01322             static int  SetBodyColour   (lua_State *L) { PROFILE
01323                 // int argc = lua_gettop(L);
01324                 Ogre::ColourValue p0;
01325                 CHECK_COLOURVALUE(p0,2);
01326                 
01327                 checkudata_alive(L)->setBodyColour(p0);
01328                 
01329                 return 0;
01330             }
01331 
01332         };
01333         
01334             // Caelum::CLASS SpriteSun
01335 
01336         class cCaelumSpriteSun_L : public cLuaBind<Caelum::SpriteSun> { public:
01337             virtual void RegisterMethods    (lua_State *L) { PROFILE
01338                 //lua_register(L,"CreateCaelumSpriteSun",    &cCaelumSpriteSun_L::CreateCaelumSpriteSun);
01339             
01340                 #define REGISTER_METHOD(methodname) mlMethod.push_back(make_luaL_reg(#methodname,&cCaelumSpriteSun_L::methodname));     
01341                 
01342                         REGISTER_METHOD(SetSunTexture); // Caelum::SpriteSun::FUNCTION void : setSunTexture : 1 params              
01343                         REGISTER_METHOD(SetSunTextureAngularSize);  // Caelum::SpriteSun::FUNCTION void : setSunTextureAngularSize : 1 params               
01344                         REGISTER_METHOD(SetBodyColour); // Caelum::SpriteSun::FUNCTION void : setBodyColour : 1 params              
01345                         //REGISTER_METHOD(NotifyCameraChanged); // Caelum::SpriteSun::FUNCTION void : notifyCameraChanged : 1 params                
01346         // NAMESPACE caelum
01347             
01348                 REGISTER_METHOD(Destroy);    
01349                 
01350                 #undef REGISTER_METHOD
01351             }
01352             virtual const char* GetLuaTypeName () { return "lugre.caelum.spritesun"; }
01353 
01355                 static int  Destroy         (lua_State *L) { PROFILE
01356                     delete checkudata_alive(L);
01357                     return 0;
01358                 }
01359                 
01360             
01362             static int  SetSunTexture   (lua_State *L) { PROFILE
01363                 // int argc = lua_gettop(L);
01364                 Ogre::String p0 = luaL_checkstring(L, 2);
01365                 
01366                 checkudata_alive(L)->setSunTexture(p0);
01367                 
01368                 return 0;
01369             }
01370 
01372             static int  SetSunTextureAngularSize    (lua_State *L) { PROFILE
01373                 // int argc = lua_gettop(L);
01374                 Ogre::Degree p0((Ogre::Real)luaL_checknumber(L, 2));
01375                 
01376                 checkudata_alive(L)->setSunTextureAngularSize(p0);
01377                 
01378                 return 0;
01379             }
01380 
01382             static int  SetBodyColour   (lua_State *L) { PROFILE
01383                 // int argc = lua_gettop(L);
01384                 Ogre::ColourValue p0;
01385                 CHECK_COLOURVALUE(p0,2);
01386                 
01387                 checkudata_alive(L)->setBodyColour(p0);
01388                 
01389                 return 0;
01390             }
01391 
01392         };
01393         
01394             // Caelum::CLASS UniversalClock
01395 
01396         class cCaelumUniversalClock_L : public cLuaBind<Caelum::UniversalClock> { public:
01397             virtual void RegisterMethods    (lua_State *L) { PROFILE
01398                 //lua_register(L,"CreateCaelumUniversalClock",    &cCaelumUniversalClock_L::CreateCaelumUniversalClock);
01399             
01400                 #define REGISTER_METHOD(methodname) mlMethod.push_back(make_luaL_reg(#methodname,&cCaelumUniversalClock_L::methodname));        
01401                 
01402                         REGISTER_METHOD(SetTimeScale);  // Caelum::UniversalClock::FUNCTION void : setTimeScale : 1 params              
01403                         REGISTER_METHOD(GetTimeScale);  // Caelum::UniversalClock::FUNCTION Ogre::Real : getTimeScale : 0 params                
01404                         REGISTER_METHOD(Update);    // Caelum::UniversalClock::FUNCTION bool : update : 1 params                
01405                         REGISTER_METHOD(SetJulianDay);  // Caelum::UniversalClock::FUNCTION void : setJulianDay : 1 params              
01406                         REGISTER_METHOD(SetGregorianDateTime);  // Caelum::UniversalClock::FUNCTION void : setGregorianDateTime : 6 params              
01407                         REGISTER_METHOD(GetJulianDay);  // Caelum::UniversalClock::FUNCTION double : getJulianDay : 0 params                
01408                         REGISTER_METHOD(GetJulianDayDifference);    // Caelum::UniversalClock::FUNCTION double : getJulianDayDifference : 0 params              
01409                         REGISTER_METHOD(GetJulianSecond);   // Caelum::UniversalClock::FUNCTION double : getJulianSecond : 0 params             
01410                         REGISTER_METHOD(GetJulianSecondDifference); // Caelum::UniversalClock::FUNCTION double : getJulianSecondDifference : 0 params               
01411                     
01412                 REGISTER_METHOD(Destroy);    
01413                 
01414                 #undef REGISTER_METHOD
01415             }
01416             virtual const char* GetLuaTypeName () { return "lugre.caelum.universalclock"; }
01417 
01419                 static int  Destroy         (lua_State *L) { PROFILE
01420                     delete checkudata_alive(L);
01421                     return 0;
01422                 }
01423                 
01424             
01426             static int  SetTimeScale    (lua_State *L) { PROFILE
01427                 // int argc = lua_gettop(L);
01428                 Ogre::Real p0 = luaL_checknumber(L, 2);
01429                 
01430                 checkudata_alive(L)->setTimeScale(p0);
01431                 
01432                 return 0;
01433             }
01434 
01436             static int  GetTimeScale    (lua_State *L) { PROFILE
01437                 // int argc = lua_gettop(L);
01438                 
01439                 Ogre::Real r = checkudata_alive(L)->getTimeScale();
01440                 
01441                 lua_pushnumber(L, r);
01442                 return 1;
01443             }
01444 
01446             static int  Update  (lua_State *L) { PROFILE
01447                 // int argc = lua_gettop(L);
01448                 Ogre::Real p0 = luaL_checknumber(L, 2);
01449                 
01450                 checkudata_alive(L)->update(p0);
01451                 
01452                 return 0;
01453             }
01454 
01456             static int  SetJulianDay    (lua_State *L) { PROFILE
01457                 // int argc = lua_gettop(L);
01458                 double p0 = luaL_checknumber(L, 2);
01459                 
01460                 checkudata_alive(L)->setJulianDay(p0);
01461                 
01462                 return 0;
01463             }
01464 
01466             static int  SetGregorianDateTime    (lua_State *L) { PROFILE
01467                 // int argc = lua_gettop(L);
01468                 int p0 = luaL_checknumber(L, 2);
01469                 int p1 = luaL_checknumber(L, 3);
01470                 int p2 = luaL_checknumber(L, 4);
01471                 int p3 = luaL_checknumber(L, 5);
01472                 int p4 = luaL_checknumber(L, 6);
01473                 double p5 = luaL_checknumber(L, 7);
01474                 
01475                 checkudata_alive(L)->setGregorianDateTime(p0, p1, p2, p3, p4, p5);
01476                 
01477                 return 0;
01478             }
01479 
01481             static int  GetJulianDay    (lua_State *L) { PROFILE
01482                 // int argc = lua_gettop(L);
01483                 
01484                 double r = checkudata_alive(L)->getJulianDay();
01485                 
01486                 lua_pushnumber(L, r);
01487                 return 1;
01488             }
01489 
01491             static int  GetJulianDayDifference  (lua_State *L) { PROFILE
01492                 // int argc = lua_gettop(L);
01493                 
01494                 double r = checkudata_alive(L)->getJulianDayDifference();
01495                 
01496                 lua_pushnumber(L, r);
01497                 return 1;
01498             }
01499 
01501             static int  GetJulianSecond (lua_State *L) { PROFILE
01502                 // int argc = lua_gettop(L);
01503                 
01504                 double r = checkudata_alive(L)->getJulianSecond();
01505                 
01506                 lua_pushnumber(L, r);
01507                 return 1;
01508             }
01509 
01511             static int  GetJulianSecondDifference   (lua_State *L) { PROFILE
01512                 // int argc = lua_gettop(L);
01513                 
01514                 double r = checkudata_alive(L)->getJulianSecondDifference();
01515                 
01516                 lua_pushnumber(L, r);
01517                 return 1;
01518             }
01519     
01520 
01521         };
01522         
01523 
01524             // Caelum::CLASS CloudSystem
01525 
01526         class cCaelumCloudSystem_L : public cLuaBind<Caelum::CloudSystem> { public:
01527             virtual void RegisterMethods    (lua_State *L) { PROFILE
01528                 //lua_register(L,"CreateCaelumCloudSystem",    &cCaelumCloudSystem_L::CreateCaelumCloudSystem);
01529             
01530                 #define REGISTER_METHOD(methodname) mlMethod.push_back(make_luaL_reg(#methodname,&cCaelumCloudSystem_L::methodname));       
01531                 
01532                         REGISTER_METHOD(ClearLayers);
01533                         REGISTER_METHOD(CreateLayerAtHeight);
01534                         REGISTER_METHOD(GetLayer);
01535                         REGISTER_METHOD(GetLayerCount);
01536                         
01537                         REGISTER_METHOD(Destroy);    
01538                 
01539                 #undef REGISTER_METHOD
01540             }
01541             virtual const char* GetLuaTypeName () { return "lugre.caelum.cloudsystem"; }
01542 
01544                 static int  Destroy         (lua_State *L) { PROFILE
01545                     delete checkudata_alive(L);
01546                     return 0;
01547                 }
01548                 
01549             
01551             static int  ClearLayers (lua_State *L) { PROFILE
01552                 // int argc = lua_gettop(L);
01553                 checkudata_alive(L)->clearLayers();
01554                 
01555                 return 0;
01556             }
01557 
01559             static int  CreateLayerAtHeight (lua_State *L) { PROFILE
01560                 // int argc = lua_gettop(L);
01561                 Ogre::Real p0((Ogre::Real)luaL_checknumber(L, 2));
01562                 
01563                 checkudata_alive(L)->createLayerAtHeight(p0);
01564                 
01565                 return 0;
01566             }
01567             
01569             static int  GetLayerCount   (lua_State *L) { PROFILE
01570                 // int argc = lua_gettop(L);
01571                 
01572                 int r = checkudata_alive(L)->getLayerCount();
01573                 
01574                 lua_pushnumber(L, r);
01575                 
01576                 return 1;
01577             }
01578 
01580             static int  GetLayer    (lua_State *L) { PROFILE
01581                 // int argc = lua_gettop(L);
01582                 int p0(luaL_checkint(L, 2));
01583                 
01584                 Caelum::FlatCloudLayer *r = checkudata_alive(L)->getLayer(p0);
01585                 
01586                 return cLuaBind<Caelum::FlatCloudLayer>::CreateUData(L,r);
01587             }
01588 
01589         };
01590         
01591             // Caelum::CLASS FlatCloudLayer
01592 
01593         class cCaelumFlatCloudLayer_L : public cLuaBind<Caelum::FlatCloudLayer> { public:
01594             virtual void RegisterMethods    (lua_State *L) { PROFILE
01595                 //lua_register(L,"CreateCaelumFlatCloudLayer",    &cCaelumFlatCloudLayer_L::CreateCaelumFlatCloudLayer);
01596             
01597                 #define REGISTER_METHOD(methodname) mlMethod.push_back(make_luaL_reg(#methodname,&cCaelumFlatCloudLayer_L::methodname));        
01598                 
01599                         REGISTER_METHOD(SetHeight);
01600                         REGISTER_METHOD(GetHeight);
01601                         REGISTER_METHOD(SetCloudSpeed);
01602                         REGISTER_METHOD(GetCloudSpeed);
01603                         REGISTER_METHOD(SetCloudCover);
01604                         REGISTER_METHOD(GetCloudCover);
01605                         REGISTER_METHOD(SetCloudCoverLookup);
01606                         REGISTER_METHOD(DisableCloudCoverLookup);
01607                         REGISTER_METHOD(SetCloudBlendTime);
01608                         REGISTER_METHOD(GetCloudBlendTime);
01609                         REGISTER_METHOD(SetCloudBlendPos);
01610                         REGISTER_METHOD(GetCloudBlendPos);
01611                                     
01612                         REGISTER_METHOD(Destroy);    
01613                 
01614                 #undef REGISTER_METHOD
01615             }
01616             virtual const char* GetLuaTypeName () { return "lugre.caelum.FlatCloudLayer"; }
01617 
01619                 static int  Destroy         (lua_State *L) { PROFILE
01620                     delete checkudata_alive(L);
01621                     return 0;
01622                 }
01623                 
01624                     
01626             static int  SetHeight   (lua_State *L) { PROFILE
01627                 // int argc = lua_gettop(L);
01628                 Ogre::Real p0((Ogre::Real)luaL_checknumber(L, 2));
01629                 
01630                 checkudata_alive(L)->setHeight(p0);
01631                 
01632                 return 0;
01633             }
01634             
01636             static int  GetHeight   (lua_State *L) { PROFILE
01637                 // int argc = lua_gettop(L);
01638                 
01639                 int r = checkudata_alive(L)->getHeight();
01640                 
01641                 lua_pushnumber(L, r);
01642                 
01643                 return 1;
01644             }
01645                     
01647             static int  SetCloudBlendPos    (lua_State *L) { PROFILE
01648                 // int argc = lua_gettop(L);
01649                 Ogre::Real p0((Ogre::Real)luaL_checknumber(L, 2));
01650                 
01651                 checkudata_alive(L)->setCloudBlendPos(p0);
01652                 
01653                 return 0;
01654             }
01655             
01657             static int  GetCloudBlendPos    (lua_State *L) { PROFILE
01658                 // int argc = lua_gettop(L);
01659                 
01660                 int r = checkudata_alive(L)->getCloudBlendPos();
01661                 
01662                 lua_pushnumber(L, r);
01663                 
01664                 return 1;
01665             }
01666                     
01668             static int  SetCloudBlendTime   (lua_State *L) { PROFILE
01669                 // int argc = lua_gettop(L);
01670                 Ogre::Real p0((Ogre::Real)luaL_checknumber(L, 2));
01671                 
01672                 checkudata_alive(L)->setCloudBlendTime(p0);
01673                 
01674                 return 0;
01675             }
01676             
01678             static int  GetCloudBlendTime   (lua_State *L) { PROFILE
01679                 // int argc = lua_gettop(L);
01680                 
01681                 int r = checkudata_alive(L)->getCloudBlendTime();
01682                 
01683                 lua_pushnumber(L, r);
01684                 
01685                 return 1;
01686             }
01687                     
01689             static int  SetCloudSpeed   (lua_State *L) { PROFILE
01690                 // int argc = lua_gettop(L);
01691                 Ogre::Vector2 p0((Ogre::Real)luaL_checknumber(L, 2),(Ogre::Real)luaL_checknumber(L, 3));
01692                 
01693                 checkudata_alive(L)->setCloudSpeed(p0);
01694                 
01695                 return 0;
01696             }
01697             
01699             static int  GetCloudSpeed   (lua_State *L) { PROFILE
01700                 // int argc = lua_gettop(L);
01701                 
01702                 // TODO currently unimplemented in caelum trunk
01703                 //~ const Ogre::Vector2 r(checkudata_alive(L)->getCloudSpeed());
01704                 //~ 
01705                 //~ lua_pushnumber(L, r.x);
01706                 //~ lua_pushnumber(L, r.y);
01707                 
01708                 lua_pushnumber(L, 0.0f);
01709                 lua_pushnumber(L, 0.0f);
01710                 
01711                 return 2;
01712             }
01713                     
01715             static int  SetCloudCover   (lua_State *L) { PROFILE
01716                 // int argc = lua_gettop(L);
01717                 Ogre::Real p0((Ogre::Real)luaL_checknumber(L, 2));
01718                 
01719                 checkudata_alive(L)->setCloudCover(p0);
01720                 
01721                 return 0;
01722             }
01723             
01725             static int  GetCloudCover   (lua_State *L) { PROFILE
01726                 // int argc = lua_gettop(L);
01727                 
01728                 int r = checkudata_alive(L)->getCloudCover();
01729                 
01730                 lua_pushnumber(L, r);
01731                 
01732                 return 1;
01733             }
01734             
01736             static int  DisableCloudCoverLookup (lua_State *L) { PROFILE
01737                 // int argc = lua_gettop(L);
01738                 
01739                 // TODO currently unimplemented in caelum trunk
01740                 //~ checkudata_alive(L)->disableCloudCoverLookup();
01741                                 
01742                 return 0;
01743             }
01744 
01746             static int  SetCloudCoverLookup (lua_State *L) { PROFILE
01747                 // int argc = lua_gettop(L);
01748                 Ogre::String p0((Ogre::String)luaL_checkstring(L, 2));
01749                 
01750                 checkudata_alive(L)->setCloudCoverLookup(p0);
01751                 
01752                 return 0;
01753             }
01754         
01755         };
01756         
01757         
01758             // Caelum::CLASS PrecipitationController
01759 
01760         class cCaelumPrecipitationController_L : public cLuaBind<Caelum::PrecipitationController> { public:
01761             virtual void RegisterMethods    (lua_State *L) { PROFILE
01762                 // lua_register(L,"CreateCaelumPrecipitationController",    &cCaelumPrecipitationController_L::CreateCaelumPrecipitationController);
01763             
01764                 #define REGISTER_METHOD(methodname) mlMethod.push_back(make_luaL_reg(#methodname,&cCaelumPrecipitationController_L::methodname));       
01765         
01766                                 REGISTER_METHOD(GetCompositorName);
01767                                 REGISTER_METHOD(GetMaterialName);
01768                                 REGISTER_METHOD(SetWindSpeed);
01769                                 REGISTER_METHOD(GetWindSpeed);
01770                                 //~ REGISTER_METHOD(SetCoverage);
01771                                 //~ REGISTER_METHOD(GetCoverage);
01772                                 REGISTER_METHOD(SetPresetType);
01773                                 REGISTER_METHOD(GetPresetType);
01774                                 REGISTER_METHOD(SetSpeed);
01775                                 REGISTER_METHOD(GetSpeed);
01776                                 REGISTER_METHOD(SetManualCameraSpeed);
01777                                 REGISTER_METHOD(SetAutoCameraSpeed);
01778                                 REGISTER_METHOD(Update);
01779             
01780                 REGISTER_METHOD(Destroy);    
01781                 
01782                 #undef REGISTER_METHOD
01783         
01784                 #define RegisterClassConstant(name,constant) cScripting::SetGlobal(L,#name,constant)
01785                 RegisterClassConstant(PRECTYPE_DRIZZLE, Caelum::PRECTYPE_DRIZZLE);
01786                 RegisterClassConstant(PRECTYPE_RAIN, Caelum::PRECTYPE_RAIN);
01787                 RegisterClassConstant(PRECTYPE_SNOW, Caelum::PRECTYPE_SNOW);
01788                 RegisterClassConstant(PRECTYPE_SNOWGRAINS, Caelum::PRECTYPE_SNOWGRAINS);
01789                 RegisterClassConstant(PRECTYPE_ICECRYSTALS, Caelum::PRECTYPE_ICECRYSTALS);
01790                 RegisterClassConstant(PRECTYPE_ICEPELLETS, Caelum::PRECTYPE_ICEPELLETS);
01791                 RegisterClassConstant(PRECTYPE_HAIL, Caelum::PRECTYPE_HAIL);
01792                 RegisterClassConstant(PRECTYPE_SMALLHAIL, Caelum::PRECTYPE_SMALLHAIL);
01793                 #undef RegisterClassConstant
01794             }
01795             virtual const char* GetLuaTypeName () { return "lugre.caelum.precipitationcontroller"; }
01796 
01798                 static int  Destroy         (lua_State *L) { PROFILE
01799                     delete checkudata_alive(L);
01800                     return 0;
01801                 }
01802 
01804             static int  Update  (lua_State *L) { PROFILE
01805                 // int argc = lua_gettop(L);
01806                 Ogre::Real p0((Ogre::Real)luaL_checknumber(L, 2));
01807                 Ogre::Real p1((Ogre::Real)luaL_checknumber(L, 3));
01808                 Ogre::Real p2((Ogre::Real)luaL_checknumber(L, 4));
01809                 Ogre::Real p3((Ogre::Real)luaL_checknumber(L, 5));
01810                 Ogre::Real p4((Ogre::Real)luaL_checknumber(L, 6));
01811                 
01812                 checkudata_alive(L)->update(p0, Ogre::ColourValue(p1,p2,p3,p4));
01813                 return 0;
01814             }
01815             
01817             static int  SetAutoCameraSpeed  (lua_State *L) { PROFILE
01818                 // int argc = lua_gettop(L);
01819 
01820                 checkudata_alive(L)->setAutoCameraSpeed();
01821                 return 0;
01822             }
01823             
01825             static int  GetMaterialName (lua_State *L) { PROFILE
01826                 // int argc = lua_gettop(L);
01827                 
01828                 lua_pushstring(L, checkudata_alive(L)->MATERIAL_NAME.c_str());
01829                 return 1;
01830             }
01831 
01833             static int  GetCompositorName   (lua_State *L) { PROFILE
01834                 // int argc = lua_gettop(L);
01835                 
01836                 lua_pushstring(L, checkudata_alive(L)->COMPOSITOR_NAME.c_str());
01837                 return 1;
01838             }
01839 
01841             static int  SetPresetType   (lua_State *L) { PROFILE
01842                 // int argc = lua_gettop(L);
01843                 Caelum::PrecipitationType p0 = (Caelum::PrecipitationType)luaL_checkint(L, 2);
01844                 
01845                 checkudata_alive(L)->setPresetType(p0);
01846                 
01847                 return 0;
01848             }
01849             
01851             static int  GetPresetType   (lua_State *L) { PROFILE
01852                 // int argc = lua_gettop(L);
01853                 
01854                 int r = (int)checkudata_alive(L)->getPresetType();
01855                 
01856                 lua_pushnumber(L, r);
01857                 
01858                 return 1;
01859             }
01860 
01862             static int  SetSpeed    (lua_State *L) { PROFILE
01863                 // int argc = lua_gettop(L);
01864                 Ogre::Real p0((Ogre::Real)luaL_checknumber(L, 2));
01865                 
01866                 checkudata_alive(L)->setSpeed(p0);
01867                 
01868                 return 0;
01869             }
01870             
01872             static int  GetSpeed    (lua_State *L) { PROFILE
01873                 // int argc = lua_gettop(L);
01874                 
01875                 int r = checkudata_alive(L)->getSpeed();
01876                 
01877                 lua_pushnumber(L, r);
01878                 
01879                 return 1;
01880             }
01881 
01882             //~ /// lua :  PrecipitationController:SetCoverage(number value)
01883             //~ static int  SetCoverage (lua_State *L) { PROFILE
01884                 //~ // int argc = lua_gettop(L);
01885                 //~ Ogre::Real p0((Ogre::Real)luaL_checknumber(L, 2));
01886                 //~ 
01887                 //~ checkudata_alive(L)->setCoverage(p0);
01888                 //~ 
01889                 //~ return 0;
01890             //~ }
01891             //~ 
01892             //~ /// lua :  number PrecipitationController:GetCoverage()
01893             //~ static int  GetCoverage (lua_State *L) { PROFILE
01894                 //~ // int argc = lua_gettop(L);
01895                 //~ 
01896                 //~ int r = checkudata_alive(L)->getCoverage();
01897                 //~ 
01898                 //~ lua_pushnumber(L, r);
01899                 //~ 
01900                 //~ return 1;
01901             //~ }   
01902 
01904             static int  SetManualCameraSpeed    (lua_State *L) { PROFILE
01905                 // int argc = lua_gettop(L);
01906                 Ogre::Vector3 p0(
01907                     (Ogre::Real)luaL_checknumber(L, 2),
01908                     (Ogre::Real)luaL_checknumber(L, 3),
01909                     (Ogre::Real)luaL_checknumber(L, 4)
01910                     );
01911                 
01912                 checkudata_alive(L)->setManualCameraSpeed(p0);
01913                 
01914                 return 0;
01915             }
01916 
01918             static int  SetWindSpeed    (lua_State *L) { PROFILE
01919                 // int argc = lua_gettop(L);
01920                 Ogre::Vector3 p0(
01921                     (Ogre::Real)luaL_checknumber(L, 2),
01922                     (Ogre::Real)luaL_checknumber(L, 3),
01923                     (Ogre::Real)luaL_checknumber(L, 4)
01924                     );
01925                 
01926                 checkudata_alive(L)->setWindSpeed(p0);
01927                 
01928                 return 0;
01929             }
01930             
01932             static int  GetWindSpeed    (lua_State *L) { PROFILE
01933                 // int argc = lua_gettop(L);
01934                 
01935                 const Ogre::Vector3 r = checkudata_alive(L)->getWindSpeed();
01936                 
01937                 lua_pushnumber(L, r.x);
01938                 lua_pushnumber(L, r.y);
01939                 lua_pushnumber(L, r.z);
01940                 
01941                 return 1;
01942             }   
01943 
01944         };
01945         
01946         
01948     void    LuaRegisterCaelum   (lua_State *L) { PROFILE
01949         cLuaBind<Caelum::Astronomy>::GetSingletonPtr(new cCaelumAstronomy_L())->LuaRegister(L);
01950         cLuaBind<Caelum::CaelumSystem>::GetSingletonPtr(new cCaelumCaelumSystem_L())->LuaRegister(L);
01951         cLuaBind<Caelum::GroundFog>::GetSingletonPtr(new cCaelumGroundFog_L())->LuaRegister(L);
01952         cLuaBind<Caelum::Moon>::GetSingletonPtr(new cCaelumMoon_L())->LuaRegister(L);
01953         cLuaBind<Caelum::SkyDome>::GetSingletonPtr(new cCaelumSkyDome_L())->LuaRegister(L);
01954         cLuaBind<Caelum::BaseSkyLight>::GetSingletonPtr(new cCaelumBaseSkyLight_L())->LuaRegister(L);
01955         cLuaBind<Caelum::SphereSun>::GetSingletonPtr(new cCaelumSphereSun_L())->LuaRegister(L);
01956         cLuaBind<Caelum::SpriteSun>::GetSingletonPtr(new cCaelumSpriteSun_L())->LuaRegister(L); 
01957         cLuaBind<Caelum::CloudSystem>::GetSingletonPtr(new cCaelumCloudSystem_L())->LuaRegister(L); 
01958         cLuaBind<Caelum::FlatCloudLayer>::GetSingletonPtr(new cCaelumFlatCloudLayer_L())->LuaRegister(L);   
01959         cLuaBind<Caelum::PrecipitationController>::GetSingletonPtr(new cCaelumPrecipitationController_L())->LuaRegister(L); 
01960         cLuaBind<Caelum::UniversalClock>::GetSingletonPtr(new cCaelumUniversalClock_L())->LuaRegister(L);   
01961     }
01962 }
01963 
01964 
01965 #undef  PUSH_COLOURVALUE
01966 #undef  CHECK_COLOURVALUE
01967 #undef  PUSH_VECTOR2
01968 #undef  CHECK_VECTOR2
01969 #undef  PUSH_VECTOR3
01970 #undef  CHECK_VECTOR3
01971 
01972 #endif

Generated on Wed May 23 06:00:14 2012 for cpp by  doxygen 1.5.6