/code/sdk/redmoon/tolua_pkg/Sphere_pkg.cpp
C++ | 485 lines | 437 code | 26 blank | 22 comment | 30 complexity | 510d72319e37947999f860e6b4a2dc81 MD5 | raw file
- /*
- ** Lua binding: Sphere
- ** Generated automatically by tolua++-1.0.92 on 11/26/11 21:54:48.
- */
-
- #ifndef __cplusplus
- #include "stdlib.h"
- #endif
- #include "string.h"
-
- #include "tolua++.h"
-
- /* Exported function */
- TOLUA_API int tolua_Sphere_open (lua_State* tolua_S);
-
- #include "inc\Sphere.h"
-
- /* function to release collected object via destructor */
- #ifdef __cplusplus
-
- static int tolua_collect_Sphere (lua_State* tolua_S)
- {
- Sphere* self = (Sphere*) tolua_tousertype(tolua_S,1,0);
- Mtolua_delete(self);
- return 0;
- }
- #endif
-
-
- /* function to register type */
- static void tolua_reg_types (lua_State* tolua_S)
- {
- tolua_usertype(tolua_S,"std::vector<Vector3>");
- tolua_usertype(tolua_S,"Sphere");
- tolua_usertype(tolua_S,"AABB");
- tolua_usertype(tolua_S,"Plane");
- tolua_usertype(tolua_S,"Vector3");
- }
-
- /* method: new of class Sphere */
- #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_new00
- static int tolua_Sphere_Sphere_new00(lua_State* tolua_S)
- {
- #ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertable(tolua_S,1,"Sphere",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,2,&tolua_err)
- )
- goto tolua_lerror;
- else
- #endif
- {
- {
- Sphere* tolua_ret = (Sphere*) Mtolua_new((Sphere)());
- tolua_pushusertype(tolua_S,(void*)tolua_ret,"Sphere");
- }
- }
- return 1;
- #ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
- return 0;
- #endif
- }
- #endif //#ifndef TOLUA_DISABLE
-
- /* method: new_local of class Sphere */
- #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_new00_local
- static int tolua_Sphere_Sphere_new00_local(lua_State* tolua_S)
- {
- #ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertable(tolua_S,1,"Sphere",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,2,&tolua_err)
- )
- goto tolua_lerror;
- else
- #endif
- {
- {
- Sphere* tolua_ret = (Sphere*) Mtolua_new((Sphere)());
- tolua_pushusertype(tolua_S,(void*)tolua_ret,"Sphere");
- tolua_register_gc(tolua_S,lua_gettop(tolua_S));
- }
- }
- return 1;
- #ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
- return 0;
- #endif
- }
- #endif //#ifndef TOLUA_DISABLE
-
- /* method: new of class Sphere */
- #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_new01
- static int tolua_Sphere_Sphere_new01(lua_State* tolua_S)
- {
- tolua_Error tolua_err;
- if (
- !tolua_isusertable(tolua_S,1,"Sphere",0,&tolua_err) ||
- (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const Vector3",0,&tolua_err)) ||
- !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,4,&tolua_err)
- )
- goto tolua_lerror;
- else
- {
- const Vector3* center = ((const Vector3*) tolua_tousertype(tolua_S,2,0));
- float radius = (( float) tolua_tonumber(tolua_S,3,0));
- {
- Sphere* tolua_ret = (Sphere*) Mtolua_new((Sphere)(*center,radius));
- tolua_pushusertype(tolua_S,(void*)tolua_ret,"Sphere");
- }
- }
- return 1;
- tolua_lerror:
- return tolua_Sphere_Sphere_new00(tolua_S);
- }
- #endif //#ifndef TOLUA_DISABLE
-
- /* method: new_local of class Sphere */
- #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_new01_local
- static int tolua_Sphere_Sphere_new01_local(lua_State* tolua_S)
- {
- tolua_Error tolua_err;
- if (
- !tolua_isusertable(tolua_S,1,"Sphere",0,&tolua_err) ||
- (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const Vector3",0,&tolua_err)) ||
- !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,4,&tolua_err)
- )
- goto tolua_lerror;
- else
- {
- const Vector3* center = ((const Vector3*) tolua_tousertype(tolua_S,2,0));
- float radius = (( float) tolua_tonumber(tolua_S,3,0));
- {
- Sphere* tolua_ret = (Sphere*) Mtolua_new((Sphere)(*center,radius));
- tolua_pushusertype(tolua_S,(void*)tolua_ret,"Sphere");
- tolua_register_gc(tolua_S,lua_gettop(tolua_S));
- }
- }
- return 1;
- tolua_lerror:
- return tolua_Sphere_Sphere_new00_local(tolua_S);
- }
- #endif //#ifndef TOLUA_DISABLE
-
- /* method: new of class Sphere */
- #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_new02
- static int tolua_Sphere_Sphere_new02(lua_State* tolua_S)
- {
- tolua_Error tolua_err;
- if (
- !tolua_isusertable(tolua_S,1,"Sphere",0,&tolua_err) ||
- !tolua_isusertype(tolua_S,2,"const std::vector<Vector3>",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,3,&tolua_err)
- )
- goto tolua_lerror;
- else
- {
- const std::vector<Vector3>* points = ((const std::vector<Vector3>*) tolua_tousertype(tolua_S,2,0));
- {
- Sphere* tolua_ret = (Sphere*) Mtolua_new((Sphere)(points));
- tolua_pushusertype(tolua_S,(void*)tolua_ret,"Sphere");
- }
- }
- return 1;
- tolua_lerror:
- return tolua_Sphere_Sphere_new01(tolua_S);
- }
- #endif //#ifndef TOLUA_DISABLE
-
- /* method: new_local of class Sphere */
- #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_new02_local
- static int tolua_Sphere_Sphere_new02_local(lua_State* tolua_S)
- {
- tolua_Error tolua_err;
- if (
- !tolua_isusertable(tolua_S,1,"Sphere",0,&tolua_err) ||
- !tolua_isusertype(tolua_S,2,"const std::vector<Vector3>",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,3,&tolua_err)
- )
- goto tolua_lerror;
- else
- {
- const std::vector<Vector3>* points = ((const std::vector<Vector3>*) tolua_tousertype(tolua_S,2,0));
- {
- Sphere* tolua_ret = (Sphere*) Mtolua_new((Sphere)(points));
- tolua_pushusertype(tolua_S,(void*)tolua_ret,"Sphere");
- tolua_register_gc(tolua_S,lua_gettop(tolua_S));
- }
- }
- return 1;
- tolua_lerror:
- return tolua_Sphere_Sphere_new01_local(tolua_S);
- }
- #endif //#ifndef TOLUA_DISABLE
-
- /* method: Radius of class Sphere */
- #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_Radius00
- static int tolua_Sphere_Sphere_Radius00(lua_State* tolua_S)
- {
- #ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"const Sphere",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,2,&tolua_err)
- )
- goto tolua_lerror;
- else
- #endif
- {
- const Sphere* self = (const Sphere*) tolua_tousertype(tolua_S,1,0);
- #ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Radius'", NULL);
- #endif
- {
- float tolua_ret = ( float) self->Radius();
- tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
- }
- }
- return 1;
- #ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'Radius'.",&tolua_err);
- return 0;
- #endif
- }
- #endif //#ifndef TOLUA_DISABLE
-
- /* method: Radius of class Sphere */
- #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_Radius01
- static int tolua_Sphere_Sphere_Radius01(lua_State* tolua_S)
- {
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Sphere",0,&tolua_err) ||
- !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,3,&tolua_err)
- )
- goto tolua_lerror;
- else
- {
- Sphere* self = (Sphere*) tolua_tousertype(tolua_S,1,0);
- float radius = (( float) tolua_tonumber(tolua_S,2,0));
- #ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Radius'", NULL);
- #endif
- {
- self->Radius(radius);
- }
- }
- return 0;
- tolua_lerror:
- return tolua_Sphere_Sphere_Radius00(tolua_S);
- }
- #endif //#ifndef TOLUA_DISABLE
-
- /* method: Center of class Sphere */
- #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_Center00
- static int tolua_Sphere_Sphere_Center00(lua_State* tolua_S)
- {
- #ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"const Sphere",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,2,&tolua_err)
- )
- goto tolua_lerror;
- else
- #endif
- {
- const Sphere* self = (const Sphere*) tolua_tousertype(tolua_S,1,0);
- #ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Center'", NULL);
- #endif
- {
- const Vector3& tolua_ret = (const Vector3&) self->Center();
- tolua_pushusertype(tolua_S,(void*)&tolua_ret,"const Vector3");
- }
- }
- return 1;
- #ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'Center'.",&tolua_err);
- return 0;
- #endif
- }
- #endif //#ifndef TOLUA_DISABLE
-
- /* method: Center of class Sphere */
- #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_Center01
- static int tolua_Sphere_Sphere_Center01(lua_State* tolua_S)
- {
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Sphere",0,&tolua_err) ||
- (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const Vector3",0,&tolua_err)) ||
- !tolua_isnoobj(tolua_S,3,&tolua_err)
- )
- goto tolua_lerror;
- else
- {
- Sphere* self = (Sphere*) tolua_tousertype(tolua_S,1,0);
- const Vector3* center = ((const Vector3*) tolua_tousertype(tolua_S,2,0));
- #ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Center'", NULL);
- #endif
- {
- self->Center(*center);
- }
- }
- return 0;
- tolua_lerror:
- return tolua_Sphere_Sphere_Center00(tolua_S);
- }
- #endif //#ifndef TOLUA_DISABLE
-
- /* method: Intersects of class Sphere */
- #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_Intersects00
- static int tolua_Sphere_Sphere_Intersects00(lua_State* tolua_S)
- {
- #ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"const Sphere",0,&tolua_err) ||
- (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const Sphere",0,&tolua_err)) ||
- !tolua_isnoobj(tolua_S,3,&tolua_err)
- )
- goto tolua_lerror;
- else
- #endif
- {
- const Sphere* self = (const Sphere*) tolua_tousertype(tolua_S,1,0);
- const Sphere* s = ((const Sphere*) tolua_tousertype(tolua_S,2,0));
- #ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Intersects'", NULL);
- #endif
- {
- bool tolua_ret = (bool) self->Intersects(*s);
- tolua_pushboolean(tolua_S,(bool)tolua_ret);
- }
- }
- return 1;
- #ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'Intersects'.",&tolua_err);
- return 0;
- #endif
- }
- #endif //#ifndef TOLUA_DISABLE
-
- /* method: Intersects of class Sphere */
- #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_Intersects01
- static int tolua_Sphere_Sphere_Intersects01(lua_State* tolua_S)
- {
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"const Sphere",0,&tolua_err) ||
- (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const AABB",0,&tolua_err)) ||
- !tolua_isnoobj(tolua_S,3,&tolua_err)
- )
- goto tolua_lerror;
- else
- {
- const Sphere* self = (const Sphere*) tolua_tousertype(tolua_S,1,0);
- const AABB* box = ((const AABB*) tolua_tousertype(tolua_S,2,0));
- #ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Intersects'", NULL);
- #endif
- {
- bool tolua_ret = (bool) self->Intersects(*box);
- tolua_pushboolean(tolua_S,(bool)tolua_ret);
- }
- }
- return 1;
- tolua_lerror:
- return tolua_Sphere_Sphere_Intersects00(tolua_S);
- }
- #endif //#ifndef TOLUA_DISABLE
-
- /* method: Intersects of class Sphere */
- #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_Intersects02
- static int tolua_Sphere_Sphere_Intersects02(lua_State* tolua_S)
- {
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"const Sphere",0,&tolua_err) ||
- (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const Plane",0,&tolua_err)) ||
- !tolua_isnoobj(tolua_S,3,&tolua_err)
- )
- goto tolua_lerror;
- else
- {
- const Sphere* self = (const Sphere*) tolua_tousertype(tolua_S,1,0);
- const Plane* plane = ((const Plane*) tolua_tousertype(tolua_S,2,0));
- #ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Intersects'", NULL);
- #endif
- {
- bool tolua_ret = (bool) self->Intersects(*plane);
- tolua_pushboolean(tolua_S,(bool)tolua_ret);
- }
- }
- return 1;
- tolua_lerror:
- return tolua_Sphere_Sphere_Intersects01(tolua_S);
- }
- #endif //#ifndef TOLUA_DISABLE
-
- /* method: Intersects of class Sphere */
- #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_Intersects03
- static int tolua_Sphere_Sphere_Intersects03(lua_State* tolua_S)
- {
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"const Sphere",0,&tolua_err) ||
- (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const Vector3",0,&tolua_err)) ||
- !tolua_isnoobj(tolua_S,3,&tolua_err)
- )
- goto tolua_lerror;
- else
- {
- const Sphere* self = (const Sphere*) tolua_tousertype(tolua_S,1,0);
- const Vector3* v = ((const Vector3*) tolua_tousertype(tolua_S,2,0));
- #ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Intersects'", NULL);
- #endif
- {
- bool tolua_ret = (bool) self->Intersects(*v);
- tolua_pushboolean(tolua_S,(bool)tolua_ret);
- }
- }
- return 1;
- tolua_lerror:
- return tolua_Sphere_Sphere_Intersects02(tolua_S);
- }
- #endif //#ifndef TOLUA_DISABLE
-
- /* Open function */
- TOLUA_API int tolua_Sphere_open (lua_State* tolua_S)
- {
- tolua_open(tolua_S);
- tolua_reg_types(tolua_S);
- tolua_module(tolua_S,NULL,0);
- tolua_beginmodule(tolua_S,NULL);
- #ifdef __cplusplus
- tolua_cclass(tolua_S,"Sphere","Sphere","",tolua_collect_Sphere);
- #else
- tolua_cclass(tolua_S,"Sphere","Sphere","",NULL);
- #endif
- tolua_beginmodule(tolua_S,"Sphere");
- tolua_function(tolua_S,"new",tolua_Sphere_Sphere_new00);
- tolua_function(tolua_S,"new_local",tolua_Sphere_Sphere_new00_local);
- tolua_function(tolua_S,".call",tolua_Sphere_Sphere_new00_local);
- tolua_function(tolua_S,"new",tolua_Sphere_Sphere_new01);
- tolua_function(tolua_S,"new_local",tolua_Sphere_Sphere_new01_local);
- tolua_function(tolua_S,".call",tolua_Sphere_Sphere_new01_local);
- tolua_function(tolua_S,"new",tolua_Sphere_Sphere_new02);
- tolua_function(tolua_S,"new_local",tolua_Sphere_Sphere_new02_local);
- tolua_function(tolua_S,".call",tolua_Sphere_Sphere_new02_local);
- tolua_function(tolua_S,"Radius",tolua_Sphere_Sphere_Radius00);
- tolua_function(tolua_S,"Radius",tolua_Sphere_Sphere_Radius01);
- tolua_function(tolua_S,"Center",tolua_Sphere_Sphere_Center00);
- tolua_function(tolua_S,"Center",tolua_Sphere_Sphere_Center01);
- tolua_function(tolua_S,"Intersects",tolua_Sphere_Sphere_Intersects00);
- tolua_function(tolua_S,"Intersects",tolua_Sphere_Sphere_Intersects01);
- tolua_function(tolua_S,"Intersects",tolua_Sphere_Sphere_Intersects02);
- tolua_function(tolua_S,"Intersects",tolua_Sphere_Sphere_Intersects03);
- tolua_endmodule(tolua_S);
- tolua_endmodule(tolua_S);
- return 1;
- }
-
-
- #if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
- TOLUA_API int luaopen_Sphere (lua_State* tolua_S) {
- return tolua_Sphere_open(tolua_S);
- };
- #endif
-