lugre_cadune_L.cpp

Go to the documentation of this file.
00001 #ifdef USE_LUGRE_LIB_CADUNE_TREE
00002 
00003 #include "lugre_prefix.h"
00004 #include "lugre_gfx3D.h"
00005 #include "lugre_scripting.h"
00006 #include "lugre_ogrewrapper.h"
00007 #include "lugre_input.h"
00008 #include "lugre_robstring.h"
00009 #include "lugre_luabind.h"
00010 #include <Ogre.h>
00011 
00012 #include "CTParameters.h"
00013 #include "CTStem.h"
00014 #include "CTSection.h"
00015 
00016 extern "C" {
00017     #include "lua.h"
00018     #include "lauxlib.h"
00019     #include "lualib.h"
00020 }
00021 
00022 using namespace Ogre;
00023 
00024 namespace Lugre {
00025     class cCaduneTreeParameters_L : public cLuaBind<CaduneTree::Parameters> { public:
00026         virtual void RegisterMethods    (lua_State *L) { PROFILE
00027             lua_register(L,"CreateCaduneTreeParameters",    &cCaduneTreeParameters_L::CreateCaduneTreeParameters);
00028         
00029             #define REGISTER_METHOD(methodname) mlMethod.push_back(make_luaL_reg(#methodname,&cCaduneTreeParameters_L::methodname));
00030             
00031             REGISTER_METHOD(Destroy);    
00032             
00033             REGISTER_METHOD(SetDefault);    // CaduneTree::Parameters::FUNCTION void : setDefault : 0 params                
00034             REGISTER_METHOD(CreateCopy);    // CaduneTree::Parameters::FUNCTION Parameters* : createCopy : 0 params             
00035             REGISTER_METHOD(SetShape);  // CaduneTree::Parameters::FUNCTION void : setShape : 1 params              
00036             REGISTER_METHOD(SetBaseSize);   // CaduneTree::Parameters::FUNCTION void : setBaseSize : 1 params               
00037             REGISTER_METHOD(SetScale);  // CaduneTree::Parameters::FUNCTION void : setScale : 1 params              
00038             REGISTER_METHOD(SetScaleV); // CaduneTree::Parameters::FUNCTION void : setScaleV : 1 params             
00039             REGISTER_METHOD(SetNumLevels);  // CaduneTree::Parameters::FUNCTION void : setNumLevels : 1 params              
00040             REGISTER_METHOD(SetRatio);  // CaduneTree::Parameters::FUNCTION void : setRatio : 1 params              
00041             REGISTER_METHOD(SetRatioPower); // CaduneTree::Parameters::FUNCTION void : setRatioPower : 1 params             
00042             REGISTER_METHOD(SetNumLobes);   // CaduneTree::Parameters::FUNCTION void : setNumLobes : 1 params               
00043             REGISTER_METHOD(SetLobeDepth);  // CaduneTree::Parameters::FUNCTION void : setLobeDepth : 1 params              
00044             REGISTER_METHOD(SetFlare);  // CaduneTree::Parameters::FUNCTION void : setFlare : 1 params              
00045             REGISTER_METHOD(SetScale0); // CaduneTree::Parameters::FUNCTION void : setScale0 : 1 params             
00046             REGISTER_METHOD(SetScale0V);    // CaduneTree::Parameters::FUNCTION void : setScale0V : 1 params                
00047             REGISTER_METHOD(SetBarkMaterial);   // CaduneTree::Parameters::FUNCTION void : setBarkMaterial : 1 params               
00048             REGISTER_METHOD(SetLeafScale);  // CaduneTree::Parameters::FUNCTION void : setLeafScale : 1 params              
00049             REGISTER_METHOD(SetLeafScaleX); // CaduneTree::Parameters::FUNCTION void : setLeafScaleX : 1 params             
00050             REGISTER_METHOD(SetNumLeaves);  // CaduneTree::Parameters::FUNCTION void : setNumLeaves : 1 params              
00051             REGISTER_METHOD(SetLeafQuality);    // CaduneTree::Parameters::FUNCTION void : setLeafQuality : 1 params                
00052             REGISTER_METHOD(SetLeafLayoutExp);  // CaduneTree::Parameters::FUNCTION void : setLeafLayoutExp : 1 params              
00053             REGISTER_METHOD(SetLeafMaterial);   // CaduneTree::Parameters::FUNCTION void : setLeafMaterial : 1 params               
00054             REGISTER_METHOD(SetFrondScale); // CaduneTree::Parameters::FUNCTION void : setFrondScale : 1 params             
00055             REGISTER_METHOD(SetFrondScaleX);    // CaduneTree::Parameters::FUNCTION void : setFrondScaleX : 1 params                
00056             REGISTER_METHOD(SetNumFronds);  // CaduneTree::Parameters::FUNCTION void : setNumFronds : 1 params              
00057             REGISTER_METHOD(SetFrondQuality);   // CaduneTree::Parameters::FUNCTION void : setFrondQuality : 1 params               
00058             REGISTER_METHOD(SetFrondMaterial);  // CaduneTree::Parameters::FUNCTION void : setFrondMaterial : 1 params              
00059             REGISTER_METHOD(SetAttractionUp);   // CaduneTree::Parameters::FUNCTION void : setAttractionUp : 1 params               
00060             REGISTER_METHOD(SetNumVertices);    // CaduneTree::Parameters::FUNCTION void : setNumVertices : 2 params                
00061             REGISTER_METHOD(SetNumBranches);    // CaduneTree::Parameters::FUNCTION void : setNumBranches : 2 params                
00062             REGISTER_METHOD(SetDownAngle);  // CaduneTree::Parameters::FUNCTION void : setDownAngle : 2 params              
00063             REGISTER_METHOD(SetDownAngleV); // CaduneTree::Parameters::FUNCTION void : setDownAngleV : 2 params             
00064             REGISTER_METHOD(SetRotate); // CaduneTree::Parameters::FUNCTION void : setRotate : 2 params             
00065             REGISTER_METHOD(SetRotateV);    // CaduneTree::Parameters::FUNCTION void : setRotateV : 2 params                
00066             REGISTER_METHOD(SetLength); // CaduneTree::Parameters::FUNCTION void : setLength : 2 params             
00067             REGISTER_METHOD(SetLengthV);    // CaduneTree::Parameters::FUNCTION void : setLengthV : 2 params                
00068             REGISTER_METHOD(SetCurve);  // CaduneTree::Parameters::FUNCTION void : setCurve : 2 params              
00069             REGISTER_METHOD(SetCurveBack);  // CaduneTree::Parameters::FUNCTION void : setCurveBack : 2 params              
00070             REGISTER_METHOD(SetCurveV); // CaduneTree::Parameters::FUNCTION void : setCurveV : 2 params             
00071             REGISTER_METHOD(SetCurveRes);   // CaduneTree::Parameters::FUNCTION void : setCurveRes : 2 params               
00072             REGISTER_METHOD(GetMaxLevels);  // CaduneTree::Parameters::FUNCTION int : getMaxLevels : 0 params               
00073             REGISTER_METHOD(GetShape);  // CaduneTree::Parameters::FUNCTION ShapeEnum : getShape : 0 params             
00074             REGISTER_METHOD(GetBaseSize);   // CaduneTree::Parameters::FUNCTION float : getBaseSize : 0 params              
00075             REGISTER_METHOD(GetScale);  // CaduneTree::Parameters::FUNCTION float : getScale : 0 params             
00076             REGISTER_METHOD(GetScaleV); // CaduneTree::Parameters::FUNCTION float : getScaleV : 0 params                
00077             REGISTER_METHOD(GetNumLevels);  // CaduneTree::Parameters::FUNCTION char : getNumLevels : 0 params              
00078             REGISTER_METHOD(GetRatio);  // CaduneTree::Parameters::FUNCTION float : getRatio : 0 params             
00079             REGISTER_METHOD(GetRatioPower); // CaduneTree::Parameters::FUNCTION float : getRatioPower : 0 params                
00080             REGISTER_METHOD(GetNumLobes);   // CaduneTree::Parameters::FUNCTION char : getNumLobes : 0 params               
00081             REGISTER_METHOD(GetLobeDepth);  // CaduneTree::Parameters::FUNCTION float : getLobeDepth : 0 params             
00082             REGISTER_METHOD(GetFlare);  // CaduneTree::Parameters::FUNCTION float : getFlare : 0 params             
00083             REGISTER_METHOD(GetScale0); // CaduneTree::Parameters::FUNCTION float : getScale0 : 0 params                
00084             REGISTER_METHOD(GetScale0V);    // CaduneTree::Parameters::FUNCTION float : getScale0V : 0 params               
00085             REGISTER_METHOD(GetBarkMaterial);   // CaduneTree::Parameters::FUNCTION Ogre::String : getBarkMaterial : 0 params               
00086             REGISTER_METHOD(GetLeafScale);  // CaduneTree::Parameters::FUNCTION float : getLeafScale : 0 params             
00087             REGISTER_METHOD(GetLeafScaleX); // CaduneTree::Parameters::FUNCTION float : getLeafScaleX : 0 params                
00088             REGISTER_METHOD(GetNumLeaves);  // CaduneTree::Parameters::FUNCTION char : getNumLeaves : 0 params              
00089             REGISTER_METHOD(GetLeafQuality);    // CaduneTree::Parameters::FUNCTION float : getLeafQuality : 0 params               
00090             REGISTER_METHOD(GetLeafLayoutExp);  // CaduneTree::Parameters::FUNCTION float : getLeafLayoutExp : 0 params             
00091             REGISTER_METHOD(GetLeafMaterial);   // CaduneTree::Parameters::FUNCTION Ogre::String : getLeafMaterial : 0 params               
00092             REGISTER_METHOD(GetFrondScale); // CaduneTree::Parameters::FUNCTION float : getFrondScale : 0 params                
00093             REGISTER_METHOD(GetFrondScaleX);    // CaduneTree::Parameters::FUNCTION float : getFrondScaleX : 0 params               
00094             REGISTER_METHOD(GetNumFronds);  // CaduneTree::Parameters::FUNCTION char : getNumFronds : 0 params              
00095             REGISTER_METHOD(GetFrondQuality);   // CaduneTree::Parameters::FUNCTION float : getFrondQuality : 0 params              
00096             REGISTER_METHOD(GetFrondMaterial);  // CaduneTree::Parameters::FUNCTION Ogre::String : getFrondMaterial : 0 params              
00097             REGISTER_METHOD(GetAttractionUp);   // CaduneTree::Parameters::FUNCTION float : getAttractionUp : 0 params              
00098             REGISTER_METHOD(GetTaper);  // CaduneTree::Parameters::FUNCTION float : getTaper : 0 params             
00099             REGISTER_METHOD(GetNumVertices);    // CaduneTree::Parameters::FUNCTION char : getNumVertices : 1 params                
00100             REGISTER_METHOD(GetNumBranches);    // CaduneTree::Parameters::FUNCTION char : getNumBranches : 1 params                
00101             REGISTER_METHOD(GetDownAngle);  // CaduneTree::Parameters::FUNCTION float : getDownAngle : 1 params             
00102             REGISTER_METHOD(GetDownAngleV); // CaduneTree::Parameters::FUNCTION float : getDownAngleV : 1 params                
00103             REGISTER_METHOD(GetRotate); // CaduneTree::Parameters::FUNCTION float : getRotate : 1 params                
00104             REGISTER_METHOD(GetRotateV);    // CaduneTree::Parameters::FUNCTION float : getRotateV : 1 params               
00105             REGISTER_METHOD(GetLength); // CaduneTree::Parameters::FUNCTION float : getLength : 1 params                
00106             REGISTER_METHOD(GetLengthV);    // CaduneTree::Parameters::FUNCTION float : getLengthV : 1 params               
00107             REGISTER_METHOD(GetCurve);  // CaduneTree::Parameters::FUNCTION float : getCurve : 1 params             
00108             REGISTER_METHOD(GetCurveBack);  // CaduneTree::Parameters::FUNCTION float : getCurveBack : 3 params             
00109             REGISTER_METHOD(GetCurveV); // CaduneTree::Parameters::FUNCTION float : getCurveV : 1 params                
00110             REGISTER_METHOD(GetCurveRes);   // CaduneTree::Parameters::FUNCTION char : getCurveRes : 2 params               
00111 
00112             #undef REGISTER_METHOD
00113             
00114             #define RegisterClassConstant(name,constant) cScripting::SetGlobal(L,#name,constant)
00115             RegisterClassConstant(CT_CONICAL,CaduneTree::CONICAL);
00116             RegisterClassConstant(CT_SPHERICAL,CaduneTree::SPHERICAL);
00117             RegisterClassConstant(CT_HEMISPHERICAL,CaduneTree::HEMISPHERICAL);
00118             RegisterClassConstant(CT_CYLINDRICAL,CaduneTree::CYLINDRICAL);
00119             RegisterClassConstant(CT_TAPERED_CYLINDRICAL,CaduneTree::TAPERED_CYLINDRICAL);
00120             RegisterClassConstant(CT_FLAME,CaduneTree::FLAME);
00121             RegisterClassConstant(CT_INVERSE_CONICAL,CaduneTree::INVERSE_CONICAL);
00122             RegisterClassConstant(CT_TEND_FLAME,CaduneTree::TEND_FLAME);
00123             #undef RegisterClassConstant
00124         }
00125         virtual const char* GetLuaTypeName () { return "lugre.cadune.parameters"; }
00126         
00127         static int  CreateCaduneTreeParameters  (lua_State *L) { PROFILE
00128             return CreateUData(L,new CaduneTree::Parameters());
00129     }
00130         
00132         static int  Destroy         (lua_State *L) { PROFILE
00133             delete checkudata_alive(L);
00134             return 0;
00135         }
00136 
00138             static int  SetDefault  (lua_State *L) { PROFILE
00139                 // int argc = lua_gettop(L);
00140                 
00141                 checkudata_alive(L)->setDefault();
00142                 
00143                 return 0;
00144             }
00145 
00147             static int  CreateCopy  (lua_State *L) { PROFILE
00148                 // int argc = lua_gettop(L);
00149                 
00150                 CaduneTree::Parameters* r = checkudata_alive(L)->createCopy();
00151                 
00152                 cLuaBind<CaduneTree::Parameters>::CreateUData(L,r);
00153                 return 1;
00154             }
00155 
00157             static int  SetShape    (lua_State *L) { PROFILE
00158                 // int argc = lua_gettop(L);
00159                 CaduneTree::ShapeEnum p0 = (CaduneTree::ShapeEnum)luaL_checkint(L, 2);
00160                 
00161                 checkudata_alive(L)->setShape(p0);
00162                 
00163                 return 0;
00164             }
00165 
00167             static int  SetBaseSize (lua_State *L) { PROFILE
00168                 // int argc = lua_gettop(L);
00169                 float p0 = luaL_checknumber(L, 2);
00170                 
00171                 checkudata_alive(L)->setBaseSize(p0);
00172                 
00173                 return 0;
00174             }
00175 
00177             static int  SetScale    (lua_State *L) { PROFILE
00178                 // int argc = lua_gettop(L);
00179                 float p0 = luaL_checknumber(L, 2);
00180                 
00181                 checkudata_alive(L)->setScale(p0);
00182                 
00183                 return 0;
00184             }
00185 
00187             static int  SetScaleV   (lua_State *L) { PROFILE
00188                 // int argc = lua_gettop(L);
00189                 float p0 = luaL_checknumber(L, 2);
00190                 
00191                 checkudata_alive(L)->setScaleV(p0);
00192                 
00193                 return 0;
00194             }
00195 
00197             static int  SetNumLevels    (lua_State *L) { PROFILE
00198                 // int argc = lua_gettop(L);
00199                 unsigned char p0 = luaL_checkint(L, 2);
00200                 
00201                 checkudata_alive(L)->setNumLevels(p0);
00202                 
00203                 return 0;
00204             }
00205 
00207             static int  SetRatio    (lua_State *L) { PROFILE
00208                 // int argc = lua_gettop(L);
00209                 float p0 = luaL_checknumber(L, 2);
00210                 
00211                 checkudata_alive(L)->setRatio(p0);
00212                 
00213                 return 0;
00214             }
00215 
00217             static int  SetRatioPower   (lua_State *L) { PROFILE
00218                 // int argc = lua_gettop(L);
00219                 float p0 = luaL_checknumber(L, 2);
00220                 
00221                 checkudata_alive(L)->setRatioPower(p0);
00222                 
00223                 return 0;
00224             }
00225 
00227             static int  SetNumLobes (lua_State *L) { PROFILE
00228                 // int argc = lua_gettop(L);
00229                 unsigned char p0 = luaL_checkint(L, 2);
00230                 
00231                 checkudata_alive(L)->setNumLobes(p0);
00232                 
00233                 return 0;
00234             }
00235 
00237             static int  SetLobeDepth    (lua_State *L) { PROFILE
00238                 // int argc = lua_gettop(L);
00239                 float p0 = luaL_checknumber(L, 2);
00240                 
00241                 checkudata_alive(L)->setLobeDepth(p0);
00242                 
00243                 return 0;
00244             }
00245 
00247             static int  SetFlare    (lua_State *L) { PROFILE
00248                 // int argc = lua_gettop(L);
00249                 float p0 = luaL_checknumber(L, 2);
00250                 
00251                 checkudata_alive(L)->setFlare(p0);
00252                 
00253                 return 0;
00254             }
00255 
00257             static int  SetScale0   (lua_State *L) { PROFILE
00258                 // int argc = lua_gettop(L);
00259                 float p0 = luaL_checknumber(L, 2);
00260                 
00261                 checkudata_alive(L)->setScale0(p0);
00262                 
00263                 return 0;
00264             }
00265 
00267             static int  SetScale0V  (lua_State *L) { PROFILE
00268                 // int argc = lua_gettop(L);
00269                 float p0 = luaL_checknumber(L, 2);
00270                 
00271                 checkudata_alive(L)->setScale0V(p0);
00272                 
00273                 return 0;
00274             }
00275 
00277             static int  SetBarkMaterial (lua_State *L) { PROFILE
00278                 // int argc = lua_gettop(L);
00279                 Ogre::String p0 = luaL_checkstring(L, 2);
00280                 
00281                 checkudata_alive(L)->setBarkMaterial(p0);
00282                 
00283                 return 0;
00284             }
00285 
00287             static int  SetLeafScale    (lua_State *L) { PROFILE
00288                 // int argc = lua_gettop(L);
00289                 float p0 = luaL_checknumber(L, 2);
00290                 
00291                 checkudata_alive(L)->setLeafScale(p0);
00292                 
00293                 return 0;
00294             }
00295 
00297             static int  SetLeafScaleX   (lua_State *L) { PROFILE
00298                 // int argc = lua_gettop(L);
00299                 float p0 = luaL_checknumber(L, 2);
00300                 
00301                 checkudata_alive(L)->setLeafScaleX(p0);
00302                 
00303                 return 0;
00304             }
00305 
00307             static int  SetNumLeaves    (lua_State *L) { PROFILE
00308                 // int argc = lua_gettop(L);
00309                 unsigned char p0 = luaL_checkint(L, 2);
00310                 
00311                 checkudata_alive(L)->setNumLeaves(p0);
00312                 
00313                 return 0;
00314             }
00315 
00317             static int  SetLeafQuality  (lua_State *L) { PROFILE
00318                 // int argc = lua_gettop(L);
00319                 float p0 = luaL_checknumber(L, 2);
00320                 
00321                 checkudata_alive(L)->setLeafQuality(p0);
00322                 
00323                 return 0;
00324             }
00325 
00327             static int  SetLeafLayoutExp    (lua_State *L) { PROFILE
00328                 // int argc = lua_gettop(L);
00329                 float p0 = luaL_checknumber(L, 2);
00330                 
00331                 checkudata_alive(L)->setLeafLayoutExp(p0);
00332                 
00333                 return 0;
00334             }
00335 
00337             static int  SetLeafMaterial (lua_State *L) { PROFILE
00338                 // int argc = lua_gettop(L);
00339                 Ogre::String p0 = luaL_checkstring(L, 2);
00340                 
00341                 checkudata_alive(L)->setLeafMaterial(p0);
00342                 
00343                 return 0;
00344             }
00345 
00347             static int  SetFrondScale   (lua_State *L) { PROFILE
00348                 // int argc = lua_gettop(L);
00349                 float p0 = luaL_checknumber(L, 2);
00350                 
00351                 checkudata_alive(L)->setFrondScale(p0);
00352                 
00353                 return 0;
00354             }
00355 
00357             static int  SetFrondScaleX  (lua_State *L) { PROFILE
00358                 // int argc = lua_gettop(L);
00359                 float p0 = luaL_checknumber(L, 2);
00360                 
00361                 checkudata_alive(L)->setFrondScaleX(p0);
00362                 
00363                 return 0;
00364             }
00365 
00367             static int  SetNumFronds    (lua_State *L) { PROFILE
00368                 // int argc = lua_gettop(L);
00369                 unsigned char p0 = luaL_checkint(L, 2);
00370                 
00371                 checkudata_alive(L)->setNumFronds(p0);
00372                 
00373                 return 0;
00374             }
00375 
00377             static int  SetFrondQuality (lua_State *L) { PROFILE
00378                 // int argc = lua_gettop(L);
00379                 float p0 = luaL_checknumber(L, 2);
00380                 
00381                 checkudata_alive(L)->setFrondQuality(p0);
00382                 
00383                 return 0;
00384             }
00385 
00387             static int  SetFrondMaterial    (lua_State *L) { PROFILE
00388                 // int argc = lua_gettop(L);
00389                 Ogre::String p0 = luaL_checkstring(L, 2);
00390                 
00391                 checkudata_alive(L)->setFrondMaterial(p0);
00392                 
00393                 return 0;
00394             }
00395 
00397             static int  SetAttractionUp (lua_State *L) { PROFILE
00398                 // int argc = lua_gettop(L);
00399                 float p0 = luaL_checknumber(L, 2);
00400                 
00401                 checkudata_alive(L)->setAttractionUp(p0);
00402                 
00403                 return 0;
00404             }
00405 
00407             static int  SetNumVertices  (lua_State *L) { PROFILE
00408                 // int argc = lua_gettop(L);
00409                 unsigned int p0 = luaL_checkint(L, 2);
00410                 unsigned char p1 = luaL_checkint(L, 3);
00411                 
00412                 checkudata_alive(L)->setNumVertices(p0, p1);
00413                 
00414                 return 0;
00415             }
00416 
00418             static int  SetNumBranches  (lua_State *L) { PROFILE
00419                 // int argc = lua_gettop(L);
00420                 unsigned int p0 = luaL_checkint(L, 2);
00421                 unsigned char p1 = luaL_checkint(L, 3);
00422                 
00423                 checkudata_alive(L)->setNumBranches(p0, p1);
00424                 
00425                 return 0;
00426             }
00427 
00429             static int  SetDownAngle    (lua_State *L) { PROFILE
00430                 // int argc = lua_gettop(L);
00431                 unsigned int p0 = luaL_checkint(L, 2);
00432                 float p1 = luaL_checknumber(L, 3);
00433                 
00434                 checkudata_alive(L)->setDownAngle(p0, p1);
00435                 
00436                 return 0;
00437             }
00438 
00440             static int  SetDownAngleV   (lua_State *L) { PROFILE
00441                 // int argc = lua_gettop(L);
00442                 unsigned int p0 = luaL_checkint(L, 2);
00443                 float p1 = luaL_checknumber(L, 3);
00444                 
00445                 checkudata_alive(L)->setDownAngleV(p0, p1);
00446                 
00447                 return 0;
00448             }
00449 
00451             static int  SetRotate   (lua_State *L) { PROFILE
00452                 // int argc = lua_gettop(L);
00453                 unsigned int p0 = luaL_checkint(L, 2);
00454                 float p1 = luaL_checknumber(L, 3);
00455                 
00456                 checkudata_alive(L)->setRotate(p0, p1);
00457                 
00458                 return 0;
00459             }
00460 
00462             static int  SetRotateV  (lua_State *L) { PROFILE
00463                 // int argc = lua_gettop(L);
00464                 unsigned int p0 = luaL_checkint(L, 2);
00465                 float p1 = luaL_checknumber(L, 3);
00466                 
00467                 checkudata_alive(L)->setRotateV(p0, p1);
00468                 
00469                 return 0;
00470             }
00471 
00473             static int  SetLength   (lua_State *L) { PROFILE
00474                 // int argc = lua_gettop(L);
00475                 unsigned int p0 = luaL_checkint(L, 2);
00476                 float p1 = luaL_checknumber(L, 3);
00477                 
00478                 checkudata_alive(L)->setLength(p0, p1);
00479                 
00480                 return 0;
00481             }
00482 
00484             static int  SetLengthV  (lua_State *L) { PROFILE
00485                 // int argc = lua_gettop(L);
00486                 unsigned int p0 = luaL_checkint(L, 2);
00487                 float p1 = luaL_checknumber(L, 3);
00488                 
00489                 checkudata_alive(L)->setLengthV(p0, p1);
00490                 
00491                 return 0;
00492             }
00493 
00495             static int  SetCurve    (lua_State *L) { PROFILE
00496                 // int argc = lua_gettop(L);
00497                 unsigned int p0 = luaL_checkint(L, 2);
00498                 float p1 = luaL_checknumber(L, 3);
00499                 
00500                 checkudata_alive(L)->setCurve(p0, p1);
00501                 
00502                 return 0;
00503             }
00504 
00506             static int  SetCurveBack    (lua_State *L) { PROFILE
00507                 // int argc = lua_gettop(L);
00508                 unsigned int p0 = luaL_checkint(L, 2);
00509                 float p1 = luaL_checknumber(L, 3);
00510                 
00511                 checkudata_alive(L)->setCurveBack(p0, p1);
00512                 
00513                 return 0;
00514             }
00515 
00517             static int  SetCurveV   (lua_State *L) { PROFILE
00518                 // int argc = lua_gettop(L);
00519                 unsigned int p0 = luaL_checkint(L, 2);
00520                 float p1 = luaL_checknumber(L, 3);
00521                 
00522                 checkudata_alive(L)->setCurveV(p0, p1);
00523                 
00524                 return 0;
00525             }
00526 
00528             static int  SetCurveRes (lua_State *L) { PROFILE
00529                 // int argc = lua_gettop(L);
00530                 unsigned int p0 = luaL_checkint(L, 2);
00531                 unsigned char p1 = luaL_checkint(L, 3);
00532                 
00533                 checkudata_alive(L)->setCurveRes(p0, p1);
00534                 
00535                 return 0;
00536             }
00537 
00539             static int  GetMaxLevels    (lua_State *L) { PROFILE
00540                 // int argc = lua_gettop(L);
00541                 
00542                 int r = checkudata_alive(L)->getMaxLevels();
00543                 
00544                 lua_pushnumber(L, r);
00545                 return 1;
00546             }
00547 
00549             static int  GetShape    (lua_State *L) { PROFILE
00550                 // int argc = lua_gettop(L);
00551                 
00552                 CaduneTree::ShapeEnum r = checkudata_alive(L)->getShape();
00553                 
00554                 lua_pushnumber(L, r);
00555                 return 1;
00556             }
00557 
00559             static int  GetBaseSize (lua_State *L) { PROFILE
00560                 // int argc = lua_gettop(L);
00561                 
00562                 float r = checkudata_alive(L)->getBaseSize();
00563                 
00564                 lua_pushnumber(L, r);
00565                 return 1;
00566             }
00567 
00569             static int  GetScale    (lua_State *L) { PROFILE
00570                 // int argc = lua_gettop(L);
00571                 
00572                 float r = checkudata_alive(L)->getScale();
00573                 
00574                 lua_pushnumber(L, r);
00575                 return 1;
00576             }
00577 
00579             static int  GetScaleV   (lua_State *L) { PROFILE
00580                 // int argc = lua_gettop(L);
00581                 
00582                 float r = checkudata_alive(L)->getScaleV();
00583                 
00584                 lua_pushnumber(L, r);
00585                 return 1;
00586             }
00587 
00589             static int  GetNumLevels    (lua_State *L) { PROFILE
00590                 // int argc = lua_gettop(L);
00591                 
00592                 char r = checkudata_alive(L)->getNumLevels();
00593                 
00594                 lua_pushnumber(L, r);
00595                 return 1;
00596             }
00597 
00599             static int  GetRatio    (lua_State *L) { PROFILE
00600                 // int argc = lua_gettop(L);
00601                 
00602                 float r = checkudata_alive(L)->getRatio();
00603                 
00604                 lua_pushnumber(L, r);
00605                 return 1;
00606             }
00607 
00609             static int  GetRatioPower   (lua_State *L) { PROFILE
00610                 // int argc = lua_gettop(L);
00611                 
00612                 float r = checkudata_alive(L)->getRatioPower();
00613                 
00614                 lua_pushnumber(L, r);
00615                 return 1;
00616             }
00617 
00619             static int  GetNumLobes (lua_State *L) { PROFILE
00620                 // int argc = lua_gettop(L);
00621                 
00622                 char r = checkudata_alive(L)->getNumLobes();
00623                 
00624                 lua_pushnumber(L, r);
00625                 return 1;
00626             }
00627 
00629             static int  GetLobeDepth    (lua_State *L) { PROFILE
00630                 // int argc = lua_gettop(L);
00631                 
00632                 float r = checkudata_alive(L)->getLobeDepth();
00633                 
00634                 lua_pushnumber(L, r);
00635                 return 1;
00636             }
00637 
00639             static int  GetFlare    (lua_State *L) { PROFILE
00640                 // int argc = lua_gettop(L);
00641                 
00642                 float r = checkudata_alive(L)->getFlare();
00643                 
00644                 lua_pushnumber(L, r);
00645                 return 1;
00646             }
00647 
00649             static int  GetScale0   (lua_State *L) { PROFILE
00650                 // int argc = lua_gettop(L);
00651                 
00652                 float r = checkudata_alive(L)->getScale0();
00653                 
00654                 lua_pushnumber(L, r);
00655                 return 1;
00656             }
00657 
00659             static int  GetScale0V  (lua_State *L) { PROFILE
00660                 // int argc = lua_gettop(L);
00661                 
00662                 float r = checkudata_alive(L)->getScale0V();
00663                 
00664                 lua_pushnumber(L, r);
00665                 return 1;
00666             }
00667 
00669             static int  GetBarkMaterial (lua_State *L) { PROFILE
00670                 // int argc = lua_gettop(L);
00671                 
00672                 Ogre::String r = checkudata_alive(L)->getBarkMaterial();
00673                 
00674                 lua_pushstring(L, r.c_str());
00675                 return 1;
00676             }
00677 
00679             static int  GetLeafScale    (lua_State *L) { PROFILE
00680                 // int argc = lua_gettop(L);
00681                 
00682                 float r = checkudata_alive(L)->getLeafScale();
00683                 
00684                 lua_pushnumber(L, r);
00685                 return 1;
00686             }
00687 
00689             static int  GetLeafScaleX   (lua_State *L) { PROFILE
00690                 // int argc = lua_gettop(L);
00691                 
00692                 float r = checkudata_alive(L)->getLeafScaleX();
00693                 
00694                 lua_pushnumber(L, r);
00695                 return 1;
00696             }
00697 
00699             static int  GetNumLeaves    (lua_State *L) { PROFILE
00700                 // int argc = lua_gettop(L);
00701                 
00702                 char r = checkudata_alive(L)->getNumLeaves();
00703                 
00704                 lua_pushnumber(L, r);
00705                 return 1;
00706             }
00707 
00709             static int  GetLeafQuality  (lua_State *L) { PROFILE
00710                 // int argc = lua_gettop(L);
00711                 
00712                 float r = checkudata_alive(L)->getLeafQuality();
00713                 
00714                 lua_pushnumber(L, r);
00715                 return 1;
00716             }
00717 
00719             static int  GetLeafLayoutExp    (lua_State *L) { PROFILE
00720                 // int argc = lua_gettop(L);
00721                 
00722                 float r = checkudata_alive(L)->getLeafLayoutExp();
00723                 
00724                 lua_pushnumber(L, r);
00725                 return 1;
00726             }
00727 
00729             static int  GetLeafMaterial (lua_State *L) { PROFILE
00730                 // int argc = lua_gettop(L);
00731                 
00732                 Ogre::String r = checkudata_alive(L)->getLeafMaterial();
00733                 
00734                 lua_pushstring(L, r.c_str());
00735                 return 1;
00736             }
00737 
00739             static int  GetFrondScale   (lua_State *L) { PROFILE
00740                 // int argc = lua_gettop(L);
00741                 
00742                 float r = checkudata_alive(L)->getFrondScale();
00743                 
00744                 lua_pushnumber(L, r);
00745                 return 1;
00746             }
00747 
00749             static int  GetFrondScaleX  (lua_State *L) { PROFILE
00750                 // int argc = lua_gettop(L);
00751                 
00752                 float r = checkudata_alive(L)->getFrondScaleX();
00753                 
00754                 lua_pushnumber(L, r);
00755                 return 1;
00756             }
00757 
00759             static int  GetNumFronds    (lua_State *L) { PROFILE
00760                 // int argc = lua_gettop(L);
00761                 
00762                 char r = checkudata_alive(L)->getNumFronds();
00763                 
00764                 lua_pushnumber(L, r);
00765                 return 1;
00766             }
00767 
00769             static int  GetFrondQuality (lua_State *L) { PROFILE
00770                 // int argc = lua_gettop(L);
00771                 
00772                 float r = checkudata_alive(L)->getFrondQuality();
00773                 
00774                 lua_pushnumber(L, r);
00775                 return 1;
00776             }
00777 
00779             static int  GetFrondMaterial    (lua_State *L) { PROFILE
00780                 // int argc = lua_gettop(L);
00781                 
00782                 Ogre::String r = checkudata_alive(L)->getFrondMaterial();
00783                 
00784                 lua_pushstring(L, r.c_str());
00785                 return 1;
00786             }
00787 
00789             static int  GetAttractionUp (lua_State *L) { PROFILE
00790                 // int argc = lua_gettop(L);
00791                 
00792                 float r = checkudata_alive(L)->getAttractionUp();
00793                 
00794                 lua_pushnumber(L, r);
00795                 return 1;
00796             }
00797 
00799             static int  GetTaper    (lua_State *L) { PROFILE
00800                 // int argc = lua_gettop(L);
00801                 
00802                 float r = checkudata_alive(L)->getTaper();
00803                 
00804                 lua_pushnumber(L, r);
00805                 return 1;
00806             }
00807 
00809             static int  GetNumVertices  (lua_State *L) { PROFILE
00810                 // int argc = lua_gettop(L);
00811                 unsigned int p0 = luaL_checkint(L, 2);
00812                 
00813                 char r = checkudata_alive(L)->getNumVertices(p0);
00814                 
00815                 lua_pushnumber(L, r);
00816                 return 1;
00817             }
00818 
00820             static int  GetNumBranches  (lua_State *L) { PROFILE
00821                 // int argc = lua_gettop(L);
00822                 unsigned int p0 = luaL_checkint(L, 2);
00823                 
00824                 char r = checkudata_alive(L)->getNumBranches(p0);
00825                 
00826                 lua_pushnumber(L, r);
00827                 return 1;
00828             }
00829 
00831             static int  GetDownAngle    (lua_State *L) { PROFILE
00832                 // int argc = lua_gettop(L);
00833                 unsigned int p0 = luaL_checkint(L, 2);
00834                 
00835                 float r = checkudata_alive(L)->getDownAngle(p0);
00836                 
00837                 lua_pushnumber(L, r);
00838                 return 1;
00839             }
00840 
00842             static int  GetDownAngleV   (lua_State *L) { PROFILE
00843                 // int argc = lua_gettop(L);
00844                 unsigned int p0 = luaL_checkint(L, 2);
00845                 
00846                 float r = checkudata_alive(L)->getDownAngleV(p0);
00847                 
00848                 lua_pushnumber(L, r);
00849                 return 1;
00850             }
00851 
00853             static int  GetRotate   (lua_State *L) { PROFILE
00854                 // int argc = lua_gettop(L);
00855                 unsigned int p0 = luaL_checkint(L, 2);
00856                 
00857                 float r = checkudata_alive(L)->getRotate(p0);
00858                 
00859                 lua_pushnumber(L, r);
00860                 return 1;
00861             }
00862 
00864             static int  GetRotateV  (lua_State *L) { PROFILE
00865                 // int argc = lua_gettop(L);
00866                 unsigned int p0 = luaL_checkint(L, 2);
00867                 
00868                 float r = checkudata_alive(L)->getRotateV(p0);
00869                 
00870                 lua_pushnumber(L, r);
00871                 return 1;
00872             }
00873 
00875             static int  GetLength   (lua_State *L) { PROFILE
00876                 // int argc = lua_gettop(L);
00877                 unsigned int p0 = luaL_checkint(L, 2);
00878                 
00879                 float r = checkudata_alive(L)->getLength(p0);
00880                 
00881                 lua_pushnumber(L, r);
00882                 return 1;
00883             }
00884 
00886             static int  GetLengthV  (lua_State *L) { PROFILE
00887                 // int argc = lua_gettop(L);
00888                 unsigned int p0 = luaL_checkint(L, 2);
00889                 
00890                 float r = checkudata_alive(L)->getLengthV(p0);
00891                 
00892                 lua_pushnumber(L, r);
00893                 return 1;
00894             }
00895 
00897             static int  GetCurve    (lua_State *L) { PROFILE
00898                 // int argc = lua_gettop(L);
00899                 unsigned int p0 = luaL_checkint(L, 2);
00900                 
00901                 float r = checkudata_alive(L)->getCurve(p0);
00902                 
00903                 lua_pushnumber(L, r);
00904                 return 1;
00905             }
00906 
00908             static int  GetCurveBack    (lua_State *L) { PROFILE
00909                 // int argc = lua_gettop(L);
00910                 unsigned int p0 = luaL_checkint(L, 2);
00911                 
00912                 float r = checkudata_alive(L)->getCurveBack(p0);
00913                 
00914                 lua_pushnumber(L, r);
00915                 return 1;
00916             }
00917 
00919             static int  GetCurveV   (lua_State *L) { PROFILE
00920                 // int argc = lua_gettop(L);
00921                 unsigned int p0 = luaL_checkint(L, 2);
00922                 
00923                 float r = checkudata_alive(L)->getCurveV(p0);
00924                 
00925                 lua_pushnumber(L, r);
00926                 return 1;
00927             }
00928 
00930             static int  GetCurveRes (lua_State *L) { PROFILE
00931                 // int argc = lua_gettop(L);
00932                 unsigned int p0 = luaL_checkint(L, 2);
00933                 
00934                 char r = checkudata_alive(L)->getCurveRes(p0);
00935                 
00936                 lua_pushnumber(L, r);
00937                 return 1;
00938             }
00939     };
00940     
00941     
00942     // ##########################################################################################
00943     // ##########################################################################################
00944     // ##########################################################################################
00945     
00946     class cCaduneTreeStem_L : public cLuaBind<CaduneTree::Stem> { public:
00947         virtual void RegisterMethods    (lua_State *L) { PROFILE
00948             lua_register(L,"CreateCaduneTreeStem",    &cCaduneTreeStem_L::CreateCaduneTreeStem);
00949         
00950             #define REGISTER_METHOD(methodname) mlMethod.push_back(make_luaL_reg(#methodname,&cCaduneTreeStem_L::methodname));
00951             
00952             REGISTER_METHOD(Grow);    
00953             REGISTER_METHOD(CreateGeometry);    
00954             REGISTER_METHOD(CreateLeaves);    
00955             REGISTER_METHOD(GetNumVerticesChildren);    
00956             REGISTER_METHOD(GetNumTrianglesChildren);    
00957             
00958             REGISTER_METHOD(Destroy);    
00959             
00960             #undef REGISTER_METHOD
00961         }
00962         virtual const char* GetLuaTypeName () { return "lugre.cadune.stem"; }
00963         
00965         static int  CreateCaduneTreeStem    (lua_State *L) { PROFILE
00966             int argc = lua_gettop(L);
00967             
00968             CaduneTree::Stem *parent = 0;
00969             CaduneTree::Parameters *parameters = 0;
00970             
00971             parameters = cLuaBind<CaduneTree::Parameters>::checkudata_alive(L,1);
00972             
00973             assert(parameters && "parameters necessary");
00974             
00975             return CreateUData(L,new CaduneTree::Stem(parameters, parent));
00976         }
00977         
00980         static int  Grow            (lua_State *L) { PROFILE
00981             CaduneTree::Stem *stem = checkudata_alive(L);
00982             int argc = lua_gettop(L) - 1;   // this pointer -> -1
00983             
00984             Ogre::Quaternion orientation;
00985             Ogre::Vector3 origin;
00986             
00987             float radius = 1.0f;
00988             float length = 1.0f;
00989             float offset = 0.0f;
00990             unsigned char level = 0;
00991             
00992             if(argc >= 4 && !lua_isnil(L,2)){ 
00993                 orientation.w = luaL_checknumber(L,2);
00994                 orientation.x = luaL_checknumber(L,3);
00995                 orientation.y = luaL_checknumber(L,4);
00996                 orientation.z = luaL_checknumber(L,5);
00997             }
00998 
00999             if(argc >= 4+3 && !lua_isnil(L,6)){ 
01000                 origin.x = luaL_checknumber(L,6);
01001                 origin.y = luaL_checknumber(L,7);
01002                 origin.z = luaL_checknumber(L,8);
01003             }
01004             
01005             if(argc >= 4+3+1 && !lua_isnil(L,9)){  radius = luaL_checknumber(L,9); }
01006             if(argc >= 4+3+2 && !lua_isnil(L,10)){  length = luaL_checknumber(L,10); }
01007             if(argc >= 4+3+3 && !lua_isnil(L,11)){   offset = luaL_checknumber(L,11); }
01008             if(argc >= 4+3+4 && !lua_isnil(L,12)){  level = static_cast<unsigned char>(myround(luaL_checknumber(L,12))); }
01009             
01010             stem->grow( orientation , origin, radius, length, offset, level );
01011 
01012             return 0;
01013         }
01014 
01017         static int  CreateGeometry          (lua_State *L) { PROFILE
01018             CaduneTree::Stem *stem = checkudata_alive(L);
01019             
01020             int argc = lua_gettop(L) - 1;   // this pointer -> -1
01021             
01022             // creates root gfx3d node
01023             Ogre::SceneManager* pSceneMgr = cOgreWrapper::GetSingleton().GetSceneManager("main");
01024             
01025             assert(pSceneMgr && "no scene manager with name main");
01026             
01027             cGfx3D* gfx = cGfx3D::NewChildOfRoot(pSceneMgr);
01028             
01029             gfx->SetManualObject(pSceneMgr->createManualObject(cOgreWrapper::GetSingleton().GetUniqueName()));
01030             
01031             stem->createGeometry(gfx->mpManualObject);
01032 
01033             return cLuaBind<cGfx3D>::CreateUData(L,gfx);
01034         }
01035 
01038         static int  CreateLeaves            (lua_State *L) { PROFILE
01039             CaduneTree::Stem *stem = checkudata_alive(L);
01040             
01041             int argc = lua_gettop(L) - 1;   // this pointer -> -1
01042             
01043             // creates root gfx3d node
01044             Ogre::SceneManager* pSceneMgr = cOgreWrapper::GetSingleton().GetSceneManager("main");
01045             
01046             assert(pSceneMgr && "no scene manager with name main");
01047             
01048             cGfx3D* gfx = cGfx3D::NewChildOfRoot(pSceneMgr);
01049             
01050             gfx->SetBillboardSet(pSceneMgr->createBillboardSet(cOgreWrapper::GetSingleton().GetUniqueName()));
01051                         
01052                         stem->createLeaves(gfx->mpBillboardSet);
01053             
01054             return cLuaBind<cGfx3D>::CreateUData(L,gfx);
01055         }
01056 
01058         static int  GetNumVerticesChildren          (lua_State *L) { PROFILE
01059             CaduneTree::Stem *stem = checkudata_alive(L);
01060             
01061             int argc = lua_gettop(L) - 1;   // this pointer -> -1
01062             
01063             lua_pushnumber(L,stem->getNumVerticesChildren());
01064             
01065             return 1;
01066         }
01067 
01069         static int  GetNumTrianglesChildren         (lua_State *L) { PROFILE
01070             CaduneTree::Stem *stem = checkudata_alive(L);
01071             
01072             int argc = lua_gettop(L) - 1;   // this pointer -> -1
01073             
01074             lua_pushnumber(L,stem->getNumTrianglesChildren());
01075             
01076             return 1;
01077         }
01078         
01079         
01081         static int  Destroy         (lua_State *L) { PROFILE
01082             delete checkudata_alive(L);
01083             return 0;
01084         }
01085     };
01086     
01087     // ##########################################################################################
01088     // ##########################################################################################
01089     // ##########################################################################################
01090 
01091     class cCaduneTreeSection_L : public cLuaBind<CaduneTree::Section> { public:
01092         virtual void RegisterMethods    (lua_State *L) { PROFILE
01093             lua_register(L,"CreateCaduneTreeSection",    &cCaduneTreeSection_L::CreateCaduneTreeSection);
01094         
01095             #define REGISTER_METHOD(methodname) mlMethod.push_back(make_luaL_reg(#methodname,&cCaduneTreeSection_L::methodname));
01096             
01097             REGISTER_METHOD(Destroy);
01098 
01099             REGISTER_METHOD(Create);    // CaduneTree::Section::FUNCTION void : create : 4 params               
01100             REGISTER_METHOD(SetOrientation);    // CaduneTree::Section::FUNCTION void : setOrientation : 1 params               
01101             REGISTER_METHOD(SetGlobalOrigin);   // CaduneTree::Section::FUNCTION void : setGlobalOrigin : 1 params              
01102             REGISTER_METHOD(SetOrigin); // CaduneTree::Section::FUNCTION void : setOrigin : 1 params                
01103             REGISTER_METHOD(SetTexVCoord);  // CaduneTree::Section::FUNCTION void : setTexVCoord : 1 params             
01104             REGISTER_METHOD(GetOrientation);    // CaduneTree::Section::FUNCTION Ogre::Quaternion : getOrientation : 0 params               
01105             REGISTER_METHOD(GetOrigin); // CaduneTree::Section::FUNCTION Ogre::Vector3 : getOrigin : 0 params               
01106             REGISTER_METHOD(GetGlobalOrigin);   // CaduneTree::Section::FUNCTION Ogre::Vector3 : getGlobalOrigin : 0 params             
01107             REGISTER_METHOD(GetTexVCoord);  // CaduneTree::Section::FUNCTION float : getTexVCoord : 0 params                
01108 
01109             #undef REGISTER_METHOD
01110         }
01111         virtual const char* GetLuaTypeName () { return "lugre.cadune.section"; }
01112         
01113         static int  CreateCaduneTreeSection (lua_State *L) { PROFILE
01114             return CreateUData(L,new CaduneTree::Section());
01115     }
01116         
01118         static int  Destroy         (lua_State *L) { PROFILE
01119             delete checkudata_alive(L);
01120             return 0;
01121         }
01122 
01124             static int  Create  (lua_State *L) { PROFILE
01125                 // int argc = lua_gettop(L);
01126                 unsigned int p0 = static_cast<unsigned int>(luaL_checknumber(L, 2));
01127                 float p1 = luaL_checknumber(L, 3);
01128                 float p2 = luaL_checknumber(L, 4);
01129                 unsigned int p3 = static_cast<unsigned int>(luaL_checknumber(L, 5));
01130                 
01131                 checkudata_alive(L)->create(p0, p1, p2, p3);
01132                 
01133                 return 0;
01134             }
01135 
01137             static int  SetOrientation  (lua_State *L) { PROFILE
01138                 // int argc = lua_gettop(L);
01139                 const Ogre::Quaternion p0(luaL_checknumber(L, 2),luaL_checknumber(L, 3),luaL_checknumber(L, 4),luaL_checknumber(L, 5));
01140                 
01141                 checkudata_alive(L)->setOrientation(p0);
01142                 
01143                 return 0;
01144             }
01145 
01147             static int  SetGlobalOrigin (lua_State *L) { PROFILE
01148                 // int argc = lua_gettop(L);
01149                 Ogre::Vector3 p0(luaL_checknumber(L, 2),luaL_checknumber(L, 3),luaL_checknumber(L, 4));
01150                 
01151                 checkudata_alive(L)->setGlobalOrigin(p0);
01152                 
01153                 return 0;
01154             }
01155 
01157             static int  SetOrigin   (lua_State *L) { PROFILE
01158                 // int argc = lua_gettop(L);
01159                 Ogre::Vector3 p0(luaL_checknumber(L, 2),luaL_checknumber(L, 3),luaL_checknumber(L, 4));
01160                 
01161                 checkudata_alive(L)->setOrigin(p0);
01162                 
01163                 return 0;
01164             }
01165 
01167             static int  SetTexVCoord    (lua_State *L) { PROFILE
01168                 // int argc = lua_gettop(L);
01169                 float p0 = luaL_checknumber(L, 2);
01170                 
01171                 checkudata_alive(L)->setTexVCoord(p0);
01172                 
01173                 return 0;
01174             }
01175 
01177             static int  GetOrientation  (lua_State *L) { PROFILE
01178                 // int argc = lua_gettop(L);
01179                 
01180                 Ogre::Quaternion r = checkudata_alive(L)->getOrientation();
01181                 
01182                 lua_pushnumber(L, r.w);
01183                 lua_pushnumber(L, r.x);
01184                 lua_pushnumber(L, r.y);
01185                 lua_pushnumber(L, r.z);
01186                 return 4;
01187             }
01188 
01190             static int  GetOrigin   (lua_State *L) { PROFILE
01191                 // int argc = lua_gettop(L);
01192                 
01193                 Ogre::Vector3 r = checkudata_alive(L)->getOrigin();
01194                 
01195                 lua_pushnumber(L, r.x);
01196                 lua_pushnumber(L, r.y);
01197                 lua_pushnumber(L, r.z);
01198                 return 3;
01199             }
01200 
01202             static int  GetGlobalOrigin (lua_State *L) { PROFILE
01203                 // int argc = lua_gettop(L);
01204                 
01205                 Ogre::Vector3 r = checkudata_alive(L)->getGlobalOrigin();
01206                 
01207                 lua_pushnumber(L, r.x);
01208                 lua_pushnumber(L, r.y);
01209                 lua_pushnumber(L, r.z);
01210                 return 3;
01211             }
01212 
01214             static int  GetTexVCoord    (lua_State *L) { PROFILE
01215                 // int argc = lua_gettop(L);
01216                 
01217                 float r = checkudata_alive(L)->getTexVCoord();
01218                 
01219                 lua_pushnumber(L, r);
01220                 return 1;
01221             }
01222     };
01223 
01224     
01225     
01227     void    LuaRegisterCaduneTree   (lua_State *L) { PROFILE
01228         cLuaBind<CaduneTree::Section>::GetSingletonPtr(new cCaduneTreeSection_L())->LuaRegister(L);
01229         cLuaBind<CaduneTree::Stem>::GetSingletonPtr(new cCaduneTreeStem_L())->LuaRegister(L);
01230         cLuaBind<CaduneTree::Parameters>::GetSingletonPtr(new cCaduneTreeParameters_L())->LuaRegister(L);
01231     }
01232 }
01233 
01234 
01235 #endif

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