PageRenderTime 25ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/code/sdk/redmoon/tolua_pkg/Sphere_pkg.cpp

http://flexible-portable-game-kit.googlecode.com/
C++ | 485 lines | 437 code | 26 blank | 22 comment | 30 complexity | 510d72319e37947999f860e6b4a2dc81 MD5 | raw file
  1. /*
  2. ** Lua binding: Sphere
  3. ** Generated automatically by tolua++-1.0.92 on 11/26/11 21:54:48.
  4. */
  5. #ifndef __cplusplus
  6. #include "stdlib.h"
  7. #endif
  8. #include "string.h"
  9. #include "tolua++.h"
  10. /* Exported function */
  11. TOLUA_API int tolua_Sphere_open (lua_State* tolua_S);
  12. #include "inc\Sphere.h"
  13. /* function to release collected object via destructor */
  14. #ifdef __cplusplus
  15. static int tolua_collect_Sphere (lua_State* tolua_S)
  16. {
  17. Sphere* self = (Sphere*) tolua_tousertype(tolua_S,1,0);
  18. Mtolua_delete(self);
  19. return 0;
  20. }
  21. #endif
  22. /* function to register type */
  23. static void tolua_reg_types (lua_State* tolua_S)
  24. {
  25. tolua_usertype(tolua_S,"std::vector<Vector3>");
  26. tolua_usertype(tolua_S,"Sphere");
  27. tolua_usertype(tolua_S,"AABB");
  28. tolua_usertype(tolua_S,"Plane");
  29. tolua_usertype(tolua_S,"Vector3");
  30. }
  31. /* method: new of class Sphere */
  32. #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_new00
  33. static int tolua_Sphere_Sphere_new00(lua_State* tolua_S)
  34. {
  35. #ifndef TOLUA_RELEASE
  36. tolua_Error tolua_err;
  37. if (
  38. !tolua_isusertable(tolua_S,1,"Sphere",0,&tolua_err) ||
  39. !tolua_isnoobj(tolua_S,2,&tolua_err)
  40. )
  41. goto tolua_lerror;
  42. else
  43. #endif
  44. {
  45. {
  46. Sphere* tolua_ret = (Sphere*) Mtolua_new((Sphere)());
  47. tolua_pushusertype(tolua_S,(void*)tolua_ret,"Sphere");
  48. }
  49. }
  50. return 1;
  51. #ifndef TOLUA_RELEASE
  52. tolua_lerror:
  53. tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
  54. return 0;
  55. #endif
  56. }
  57. #endif //#ifndef TOLUA_DISABLE
  58. /* method: new_local of class Sphere */
  59. #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_new00_local
  60. static int tolua_Sphere_Sphere_new00_local(lua_State* tolua_S)
  61. {
  62. #ifndef TOLUA_RELEASE
  63. tolua_Error tolua_err;
  64. if (
  65. !tolua_isusertable(tolua_S,1,"Sphere",0,&tolua_err) ||
  66. !tolua_isnoobj(tolua_S,2,&tolua_err)
  67. )
  68. goto tolua_lerror;
  69. else
  70. #endif
  71. {
  72. {
  73. Sphere* tolua_ret = (Sphere*) Mtolua_new((Sphere)());
  74. tolua_pushusertype(tolua_S,(void*)tolua_ret,"Sphere");
  75. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  76. }
  77. }
  78. return 1;
  79. #ifndef TOLUA_RELEASE
  80. tolua_lerror:
  81. tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
  82. return 0;
  83. #endif
  84. }
  85. #endif //#ifndef TOLUA_DISABLE
  86. /* method: new of class Sphere */
  87. #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_new01
  88. static int tolua_Sphere_Sphere_new01(lua_State* tolua_S)
  89. {
  90. tolua_Error tolua_err;
  91. if (
  92. !tolua_isusertable(tolua_S,1,"Sphere",0,&tolua_err) ||
  93. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const Vector3",0,&tolua_err)) ||
  94. !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
  95. !tolua_isnoobj(tolua_S,4,&tolua_err)
  96. )
  97. goto tolua_lerror;
  98. else
  99. {
  100. const Vector3* center = ((const Vector3*) tolua_tousertype(tolua_S,2,0));
  101. float radius = (( float) tolua_tonumber(tolua_S,3,0));
  102. {
  103. Sphere* tolua_ret = (Sphere*) Mtolua_new((Sphere)(*center,radius));
  104. tolua_pushusertype(tolua_S,(void*)tolua_ret,"Sphere");
  105. }
  106. }
  107. return 1;
  108. tolua_lerror:
  109. return tolua_Sphere_Sphere_new00(tolua_S);
  110. }
  111. #endif //#ifndef TOLUA_DISABLE
  112. /* method: new_local of class Sphere */
  113. #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_new01_local
  114. static int tolua_Sphere_Sphere_new01_local(lua_State* tolua_S)
  115. {
  116. tolua_Error tolua_err;
  117. if (
  118. !tolua_isusertable(tolua_S,1,"Sphere",0,&tolua_err) ||
  119. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const Vector3",0,&tolua_err)) ||
  120. !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
  121. !tolua_isnoobj(tolua_S,4,&tolua_err)
  122. )
  123. goto tolua_lerror;
  124. else
  125. {
  126. const Vector3* center = ((const Vector3*) tolua_tousertype(tolua_S,2,0));
  127. float radius = (( float) tolua_tonumber(tolua_S,3,0));
  128. {
  129. Sphere* tolua_ret = (Sphere*) Mtolua_new((Sphere)(*center,radius));
  130. tolua_pushusertype(tolua_S,(void*)tolua_ret,"Sphere");
  131. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  132. }
  133. }
  134. return 1;
  135. tolua_lerror:
  136. return tolua_Sphere_Sphere_new00_local(tolua_S);
  137. }
  138. #endif //#ifndef TOLUA_DISABLE
  139. /* method: new of class Sphere */
  140. #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_new02
  141. static int tolua_Sphere_Sphere_new02(lua_State* tolua_S)
  142. {
  143. tolua_Error tolua_err;
  144. if (
  145. !tolua_isusertable(tolua_S,1,"Sphere",0,&tolua_err) ||
  146. !tolua_isusertype(tolua_S,2,"const std::vector<Vector3>",0,&tolua_err) ||
  147. !tolua_isnoobj(tolua_S,3,&tolua_err)
  148. )
  149. goto tolua_lerror;
  150. else
  151. {
  152. const std::vector<Vector3>* points = ((const std::vector<Vector3>*) tolua_tousertype(tolua_S,2,0));
  153. {
  154. Sphere* tolua_ret = (Sphere*) Mtolua_new((Sphere)(points));
  155. tolua_pushusertype(tolua_S,(void*)tolua_ret,"Sphere");
  156. }
  157. }
  158. return 1;
  159. tolua_lerror:
  160. return tolua_Sphere_Sphere_new01(tolua_S);
  161. }
  162. #endif //#ifndef TOLUA_DISABLE
  163. /* method: new_local of class Sphere */
  164. #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_new02_local
  165. static int tolua_Sphere_Sphere_new02_local(lua_State* tolua_S)
  166. {
  167. tolua_Error tolua_err;
  168. if (
  169. !tolua_isusertable(tolua_S,1,"Sphere",0,&tolua_err) ||
  170. !tolua_isusertype(tolua_S,2,"const std::vector<Vector3>",0,&tolua_err) ||
  171. !tolua_isnoobj(tolua_S,3,&tolua_err)
  172. )
  173. goto tolua_lerror;
  174. else
  175. {
  176. const std::vector<Vector3>* points = ((const std::vector<Vector3>*) tolua_tousertype(tolua_S,2,0));
  177. {
  178. Sphere* tolua_ret = (Sphere*) Mtolua_new((Sphere)(points));
  179. tolua_pushusertype(tolua_S,(void*)tolua_ret,"Sphere");
  180. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  181. }
  182. }
  183. return 1;
  184. tolua_lerror:
  185. return tolua_Sphere_Sphere_new01_local(tolua_S);
  186. }
  187. #endif //#ifndef TOLUA_DISABLE
  188. /* method: Radius of class Sphere */
  189. #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_Radius00
  190. static int tolua_Sphere_Sphere_Radius00(lua_State* tolua_S)
  191. {
  192. #ifndef TOLUA_RELEASE
  193. tolua_Error tolua_err;
  194. if (
  195. !tolua_isusertype(tolua_S,1,"const Sphere",0,&tolua_err) ||
  196. !tolua_isnoobj(tolua_S,2,&tolua_err)
  197. )
  198. goto tolua_lerror;
  199. else
  200. #endif
  201. {
  202. const Sphere* self = (const Sphere*) tolua_tousertype(tolua_S,1,0);
  203. #ifndef TOLUA_RELEASE
  204. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Radius'", NULL);
  205. #endif
  206. {
  207. float tolua_ret = ( float) self->Radius();
  208. tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  209. }
  210. }
  211. return 1;
  212. #ifndef TOLUA_RELEASE
  213. tolua_lerror:
  214. tolua_error(tolua_S,"#ferror in function 'Radius'.",&tolua_err);
  215. return 0;
  216. #endif
  217. }
  218. #endif //#ifndef TOLUA_DISABLE
  219. /* method: Radius of class Sphere */
  220. #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_Radius01
  221. static int tolua_Sphere_Sphere_Radius01(lua_State* tolua_S)
  222. {
  223. tolua_Error tolua_err;
  224. if (
  225. !tolua_isusertype(tolua_S,1,"Sphere",0,&tolua_err) ||
  226. !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
  227. !tolua_isnoobj(tolua_S,3,&tolua_err)
  228. )
  229. goto tolua_lerror;
  230. else
  231. {
  232. Sphere* self = (Sphere*) tolua_tousertype(tolua_S,1,0);
  233. float radius = (( float) tolua_tonumber(tolua_S,2,0));
  234. #ifndef TOLUA_RELEASE
  235. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Radius'", NULL);
  236. #endif
  237. {
  238. self->Radius(radius);
  239. }
  240. }
  241. return 0;
  242. tolua_lerror:
  243. return tolua_Sphere_Sphere_Radius00(tolua_S);
  244. }
  245. #endif //#ifndef TOLUA_DISABLE
  246. /* method: Center of class Sphere */
  247. #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_Center00
  248. static int tolua_Sphere_Sphere_Center00(lua_State* tolua_S)
  249. {
  250. #ifndef TOLUA_RELEASE
  251. tolua_Error tolua_err;
  252. if (
  253. !tolua_isusertype(tolua_S,1,"const Sphere",0,&tolua_err) ||
  254. !tolua_isnoobj(tolua_S,2,&tolua_err)
  255. )
  256. goto tolua_lerror;
  257. else
  258. #endif
  259. {
  260. const Sphere* self = (const Sphere*) tolua_tousertype(tolua_S,1,0);
  261. #ifndef TOLUA_RELEASE
  262. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Center'", NULL);
  263. #endif
  264. {
  265. const Vector3& tolua_ret = (const Vector3&) self->Center();
  266. tolua_pushusertype(tolua_S,(void*)&tolua_ret,"const Vector3");
  267. }
  268. }
  269. return 1;
  270. #ifndef TOLUA_RELEASE
  271. tolua_lerror:
  272. tolua_error(tolua_S,"#ferror in function 'Center'.",&tolua_err);
  273. return 0;
  274. #endif
  275. }
  276. #endif //#ifndef TOLUA_DISABLE
  277. /* method: Center of class Sphere */
  278. #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_Center01
  279. static int tolua_Sphere_Sphere_Center01(lua_State* tolua_S)
  280. {
  281. tolua_Error tolua_err;
  282. if (
  283. !tolua_isusertype(tolua_S,1,"Sphere",0,&tolua_err) ||
  284. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const Vector3",0,&tolua_err)) ||
  285. !tolua_isnoobj(tolua_S,3,&tolua_err)
  286. )
  287. goto tolua_lerror;
  288. else
  289. {
  290. Sphere* self = (Sphere*) tolua_tousertype(tolua_S,1,0);
  291. const Vector3* center = ((const Vector3*) tolua_tousertype(tolua_S,2,0));
  292. #ifndef TOLUA_RELEASE
  293. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Center'", NULL);
  294. #endif
  295. {
  296. self->Center(*center);
  297. }
  298. }
  299. return 0;
  300. tolua_lerror:
  301. return tolua_Sphere_Sphere_Center00(tolua_S);
  302. }
  303. #endif //#ifndef TOLUA_DISABLE
  304. /* method: Intersects of class Sphere */
  305. #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_Intersects00
  306. static int tolua_Sphere_Sphere_Intersects00(lua_State* tolua_S)
  307. {
  308. #ifndef TOLUA_RELEASE
  309. tolua_Error tolua_err;
  310. if (
  311. !tolua_isusertype(tolua_S,1,"const Sphere",0,&tolua_err) ||
  312. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const Sphere",0,&tolua_err)) ||
  313. !tolua_isnoobj(tolua_S,3,&tolua_err)
  314. )
  315. goto tolua_lerror;
  316. else
  317. #endif
  318. {
  319. const Sphere* self = (const Sphere*) tolua_tousertype(tolua_S,1,0);
  320. const Sphere* s = ((const Sphere*) tolua_tousertype(tolua_S,2,0));
  321. #ifndef TOLUA_RELEASE
  322. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Intersects'", NULL);
  323. #endif
  324. {
  325. bool tolua_ret = (bool) self->Intersects(*s);
  326. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  327. }
  328. }
  329. return 1;
  330. #ifndef TOLUA_RELEASE
  331. tolua_lerror:
  332. tolua_error(tolua_S,"#ferror in function 'Intersects'.",&tolua_err);
  333. return 0;
  334. #endif
  335. }
  336. #endif //#ifndef TOLUA_DISABLE
  337. /* method: Intersects of class Sphere */
  338. #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_Intersects01
  339. static int tolua_Sphere_Sphere_Intersects01(lua_State* tolua_S)
  340. {
  341. tolua_Error tolua_err;
  342. if (
  343. !tolua_isusertype(tolua_S,1,"const Sphere",0,&tolua_err) ||
  344. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const AABB",0,&tolua_err)) ||
  345. !tolua_isnoobj(tolua_S,3,&tolua_err)
  346. )
  347. goto tolua_lerror;
  348. else
  349. {
  350. const Sphere* self = (const Sphere*) tolua_tousertype(tolua_S,1,0);
  351. const AABB* box = ((const AABB*) tolua_tousertype(tolua_S,2,0));
  352. #ifndef TOLUA_RELEASE
  353. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Intersects'", NULL);
  354. #endif
  355. {
  356. bool tolua_ret = (bool) self->Intersects(*box);
  357. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  358. }
  359. }
  360. return 1;
  361. tolua_lerror:
  362. return tolua_Sphere_Sphere_Intersects00(tolua_S);
  363. }
  364. #endif //#ifndef TOLUA_DISABLE
  365. /* method: Intersects of class Sphere */
  366. #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_Intersects02
  367. static int tolua_Sphere_Sphere_Intersects02(lua_State* tolua_S)
  368. {
  369. tolua_Error tolua_err;
  370. if (
  371. !tolua_isusertype(tolua_S,1,"const Sphere",0,&tolua_err) ||
  372. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const Plane",0,&tolua_err)) ||
  373. !tolua_isnoobj(tolua_S,3,&tolua_err)
  374. )
  375. goto tolua_lerror;
  376. else
  377. {
  378. const Sphere* self = (const Sphere*) tolua_tousertype(tolua_S,1,0);
  379. const Plane* plane = ((const Plane*) tolua_tousertype(tolua_S,2,0));
  380. #ifndef TOLUA_RELEASE
  381. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Intersects'", NULL);
  382. #endif
  383. {
  384. bool tolua_ret = (bool) self->Intersects(*plane);
  385. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  386. }
  387. }
  388. return 1;
  389. tolua_lerror:
  390. return tolua_Sphere_Sphere_Intersects01(tolua_S);
  391. }
  392. #endif //#ifndef TOLUA_DISABLE
  393. /* method: Intersects of class Sphere */
  394. #ifndef TOLUA_DISABLE_tolua_Sphere_Sphere_Intersects03
  395. static int tolua_Sphere_Sphere_Intersects03(lua_State* tolua_S)
  396. {
  397. tolua_Error tolua_err;
  398. if (
  399. !tolua_isusertype(tolua_S,1,"const Sphere",0,&tolua_err) ||
  400. (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const Vector3",0,&tolua_err)) ||
  401. !tolua_isnoobj(tolua_S,3,&tolua_err)
  402. )
  403. goto tolua_lerror;
  404. else
  405. {
  406. const Sphere* self = (const Sphere*) tolua_tousertype(tolua_S,1,0);
  407. const Vector3* v = ((const Vector3*) tolua_tousertype(tolua_S,2,0));
  408. #ifndef TOLUA_RELEASE
  409. if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Intersects'", NULL);
  410. #endif
  411. {
  412. bool tolua_ret = (bool) self->Intersects(*v);
  413. tolua_pushboolean(tolua_S,(bool)tolua_ret);
  414. }
  415. }
  416. return 1;
  417. tolua_lerror:
  418. return tolua_Sphere_Sphere_Intersects02(tolua_S);
  419. }
  420. #endif //#ifndef TOLUA_DISABLE
  421. /* Open function */
  422. TOLUA_API int tolua_Sphere_open (lua_State* tolua_S)
  423. {
  424. tolua_open(tolua_S);
  425. tolua_reg_types(tolua_S);
  426. tolua_module(tolua_S,NULL,0);
  427. tolua_beginmodule(tolua_S,NULL);
  428. #ifdef __cplusplus
  429. tolua_cclass(tolua_S,"Sphere","Sphere","",tolua_collect_Sphere);
  430. #else
  431. tolua_cclass(tolua_S,"Sphere","Sphere","",NULL);
  432. #endif
  433. tolua_beginmodule(tolua_S,"Sphere");
  434. tolua_function(tolua_S,"new",tolua_Sphere_Sphere_new00);
  435. tolua_function(tolua_S,"new_local",tolua_Sphere_Sphere_new00_local);
  436. tolua_function(tolua_S,".call",tolua_Sphere_Sphere_new00_local);
  437. tolua_function(tolua_S,"new",tolua_Sphere_Sphere_new01);
  438. tolua_function(tolua_S,"new_local",tolua_Sphere_Sphere_new01_local);
  439. tolua_function(tolua_S,".call",tolua_Sphere_Sphere_new01_local);
  440. tolua_function(tolua_S,"new",tolua_Sphere_Sphere_new02);
  441. tolua_function(tolua_S,"new_local",tolua_Sphere_Sphere_new02_local);
  442. tolua_function(tolua_S,".call",tolua_Sphere_Sphere_new02_local);
  443. tolua_function(tolua_S,"Radius",tolua_Sphere_Sphere_Radius00);
  444. tolua_function(tolua_S,"Radius",tolua_Sphere_Sphere_Radius01);
  445. tolua_function(tolua_S,"Center",tolua_Sphere_Sphere_Center00);
  446. tolua_function(tolua_S,"Center",tolua_Sphere_Sphere_Center01);
  447. tolua_function(tolua_S,"Intersects",tolua_Sphere_Sphere_Intersects00);
  448. tolua_function(tolua_S,"Intersects",tolua_Sphere_Sphere_Intersects01);
  449. tolua_function(tolua_S,"Intersects",tolua_Sphere_Sphere_Intersects02);
  450. tolua_function(tolua_S,"Intersects",tolua_Sphere_Sphere_Intersects03);
  451. tolua_endmodule(tolua_S);
  452. tolua_endmodule(tolua_S);
  453. return 1;
  454. }
  455. #if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
  456. TOLUA_API int luaopen_Sphere (lua_State* tolua_S) {
  457. return tolua_Sphere_open(tolua_S);
  458. };
  459. #endif