lua_BoundingBox.cpp 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696
  1. #include "Base.h"
  2. #include "ScriptController.h"
  3. #include "lua_BoundingBox.h"
  4. #include "Base.h"
  5. #include "BoundingBox.h"
  6. #include "BoundingSphere.h"
  7. #include "Plane.h"
  8. namespace gameplay
  9. {
  10. void luaRegister_BoundingBox()
  11. {
  12. const luaL_Reg lua_members[] =
  13. {
  14. {"getCenter", lua_BoundingBox_getCenter},
  15. {"getCorners", lua_BoundingBox_getCorners},
  16. {"intersects", lua_BoundingBox_intersects},
  17. {"isEmpty", lua_BoundingBox_isEmpty},
  18. {"max", lua_BoundingBox_max},
  19. {"merge", lua_BoundingBox_merge},
  20. {"min", lua_BoundingBox_min},
  21. {"set", lua_BoundingBox_set},
  22. {"transform", lua_BoundingBox_transform},
  23. {NULL, NULL}
  24. };
  25. const luaL_Reg lua_statics[] =
  26. {
  27. {"empty", lua_BoundingBox_static_empty},
  28. {NULL, NULL}
  29. };
  30. std::vector<std::string> scopePath;
  31. ScriptUtil::registerClass("BoundingBox", lua_members, lua_BoundingBox__init, lua_BoundingBox__gc, lua_statics, scopePath);
  32. }
  33. static BoundingBox* getInstance(lua_State* state)
  34. {
  35. void* userdata = luaL_checkudata(state, 1, "BoundingBox");
  36. luaL_argcheck(state, userdata != NULL, 1, "'BoundingBox' expected.");
  37. return (BoundingBox*)((ScriptUtil::LuaObject*)userdata)->instance;
  38. }
  39. int lua_BoundingBox__gc(lua_State* state)
  40. {
  41. // Get the number of parameters.
  42. int paramCount = lua_gettop(state);
  43. // Attempt to match the parameters to a valid binding.
  44. switch (paramCount)
  45. {
  46. case 1:
  47. {
  48. if ((lua_type(state, 1) == LUA_TUSERDATA))
  49. {
  50. void* userdata = luaL_checkudata(state, 1, "BoundingBox");
  51. luaL_argcheck(state, userdata != NULL, 1, "'BoundingBox' expected.");
  52. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)userdata;
  53. if (object->owns)
  54. {
  55. BoundingBox* instance = (BoundingBox*)object->instance;
  56. SAFE_DELETE(instance);
  57. }
  58. return 0;
  59. }
  60. else
  61. {
  62. lua_pushstring(state, "lua_BoundingBox__gc - Failed to match the given parameters to a valid function signature.");
  63. lua_error(state);
  64. }
  65. break;
  66. }
  67. default:
  68. {
  69. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  70. lua_error(state);
  71. break;
  72. }
  73. }
  74. return 0;
  75. }
  76. int lua_BoundingBox__init(lua_State* state)
  77. {
  78. // Get the number of parameters.
  79. int paramCount = lua_gettop(state);
  80. // Attempt to match the parameters to a valid binding.
  81. switch (paramCount)
  82. {
  83. case 0:
  84. {
  85. void* returnPtr = (void*)new BoundingBox();
  86. if (returnPtr)
  87. {
  88. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  89. object->instance = returnPtr;
  90. object->owns = true;
  91. luaL_getmetatable(state, "BoundingBox");
  92. lua_setmetatable(state, -2);
  93. }
  94. else
  95. {
  96. lua_pushnil(state);
  97. }
  98. return 1;
  99. break;
  100. }
  101. case 1:
  102. {
  103. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  104. {
  105. // Get parameter 1 off the stack.
  106. ScriptUtil::LuaArray<BoundingBox> param1 = ScriptUtil::getObjectPointer<BoundingBox>(1, "BoundingBox", true);
  107. void* returnPtr = (void*)new BoundingBox(*param1);
  108. if (returnPtr)
  109. {
  110. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  111. object->instance = returnPtr;
  112. object->owns = true;
  113. luaL_getmetatable(state, "BoundingBox");
  114. lua_setmetatable(state, -2);
  115. }
  116. else
  117. {
  118. lua_pushnil(state);
  119. }
  120. return 1;
  121. }
  122. else
  123. {
  124. lua_pushstring(state, "lua_BoundingBox__init - Failed to match the given parameters to a valid function signature.");
  125. lua_error(state);
  126. }
  127. break;
  128. }
  129. case 2:
  130. {
  131. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  132. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  133. {
  134. // Get parameter 1 off the stack.
  135. ScriptUtil::LuaArray<Vector3> param1 = ScriptUtil::getObjectPointer<Vector3>(1, "Vector3", true);
  136. // Get parameter 2 off the stack.
  137. ScriptUtil::LuaArray<Vector3> param2 = ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true);
  138. void* returnPtr = (void*)new BoundingBox(*param1, *param2);
  139. if (returnPtr)
  140. {
  141. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  142. object->instance = returnPtr;
  143. object->owns = true;
  144. luaL_getmetatable(state, "BoundingBox");
  145. lua_setmetatable(state, -2);
  146. }
  147. else
  148. {
  149. lua_pushnil(state);
  150. }
  151. return 1;
  152. }
  153. else
  154. {
  155. lua_pushstring(state, "lua_BoundingBox__init - Failed to match the given parameters to a valid function signature.");
  156. lua_error(state);
  157. }
  158. break;
  159. }
  160. default:
  161. {
  162. lua_pushstring(state, "Invalid number of parameters (expected 0, 1 or 2).");
  163. lua_error(state);
  164. break;
  165. }
  166. }
  167. return 0;
  168. }
  169. int lua_BoundingBox_getCenter(lua_State* state)
  170. {
  171. // Get the number of parameters.
  172. int paramCount = lua_gettop(state);
  173. // Attempt to match the parameters to a valid binding.
  174. switch (paramCount)
  175. {
  176. case 1:
  177. {
  178. if ((lua_type(state, 1) == LUA_TUSERDATA))
  179. {
  180. BoundingBox* instance = getInstance(state);
  181. void* returnPtr = (void*)new Vector3(instance->getCenter());
  182. if (returnPtr)
  183. {
  184. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  185. object->instance = returnPtr;
  186. object->owns = true;
  187. luaL_getmetatable(state, "Vector3");
  188. lua_setmetatable(state, -2);
  189. }
  190. else
  191. {
  192. lua_pushnil(state);
  193. }
  194. return 1;
  195. }
  196. else
  197. {
  198. lua_pushstring(state, "lua_BoundingBox_getCenter - Failed to match the given parameters to a valid function signature.");
  199. lua_error(state);
  200. }
  201. break;
  202. }
  203. case 2:
  204. {
  205. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  206. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  207. {
  208. // Get parameter 1 off the stack.
  209. ScriptUtil::LuaArray<Vector3> param1 = ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", false);
  210. BoundingBox* instance = getInstance(state);
  211. instance->getCenter(param1);
  212. return 0;
  213. }
  214. else
  215. {
  216. lua_pushstring(state, "lua_BoundingBox_getCenter - Failed to match the given parameters to a valid function signature.");
  217. lua_error(state);
  218. }
  219. break;
  220. }
  221. default:
  222. {
  223. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  224. lua_error(state);
  225. break;
  226. }
  227. }
  228. return 0;
  229. }
  230. int lua_BoundingBox_getCorners(lua_State* state)
  231. {
  232. // Get the number of parameters.
  233. int paramCount = lua_gettop(state);
  234. // Attempt to match the parameters to a valid binding.
  235. switch (paramCount)
  236. {
  237. case 2:
  238. {
  239. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  240. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  241. {
  242. // Get parameter 1 off the stack.
  243. ScriptUtil::LuaArray<Vector3> param1 = ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", false);
  244. BoundingBox* instance = getInstance(state);
  245. instance->getCorners(param1);
  246. return 0;
  247. }
  248. else
  249. {
  250. lua_pushstring(state, "lua_BoundingBox_getCorners - Failed to match the given parameters to a valid function signature.");
  251. lua_error(state);
  252. }
  253. break;
  254. }
  255. default:
  256. {
  257. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  258. lua_error(state);
  259. break;
  260. }
  261. }
  262. return 0;
  263. }
  264. int lua_BoundingBox_intersects(lua_State* state)
  265. {
  266. // Get the number of parameters.
  267. int paramCount = lua_gettop(state);
  268. // Attempt to match the parameters to a valid binding.
  269. switch (paramCount)
  270. {
  271. case 2:
  272. {
  273. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  274. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  275. {
  276. // Get parameter 1 off the stack.
  277. ScriptUtil::LuaArray<BoundingBox> param1 = ScriptUtil::getObjectPointer<BoundingBox>(2, "BoundingBox", true);
  278. BoundingBox* instance = getInstance(state);
  279. bool result = instance->intersects(*param1);
  280. // Push the return value onto the stack.
  281. lua_pushboolean(state, result);
  282. return 1;
  283. }
  284. else if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  285. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  286. {
  287. // Get parameter 1 off the stack.
  288. ScriptUtil::LuaArray<BoundingSphere> param1 = ScriptUtil::getObjectPointer<BoundingSphere>(2, "BoundingSphere", true);
  289. BoundingBox* instance = getInstance(state);
  290. bool result = instance->intersects(*param1);
  291. // Push the return value onto the stack.
  292. lua_pushboolean(state, result);
  293. return 1;
  294. }
  295. else if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  296. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  297. {
  298. // Get parameter 1 off the stack.
  299. ScriptUtil::LuaArray<Frustum> param1 = ScriptUtil::getObjectPointer<Frustum>(2, "Frustum", true);
  300. BoundingBox* instance = getInstance(state);
  301. bool result = instance->intersects(*param1);
  302. // Push the return value onto the stack.
  303. lua_pushboolean(state, result);
  304. return 1;
  305. }
  306. else if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  307. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  308. {
  309. // Get parameter 1 off the stack.
  310. ScriptUtil::LuaArray<Plane> param1 = ScriptUtil::getObjectPointer<Plane>(2, "Plane", true);
  311. BoundingBox* instance = getInstance(state);
  312. float result = instance->intersects(*param1);
  313. // Push the return value onto the stack.
  314. lua_pushnumber(state, result);
  315. return 1;
  316. }
  317. else if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  318. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  319. {
  320. // Get parameter 1 off the stack.
  321. ScriptUtil::LuaArray<Ray> param1 = ScriptUtil::getObjectPointer<Ray>(2, "Ray", true);
  322. BoundingBox* instance = getInstance(state);
  323. float result = instance->intersects(*param1);
  324. // Push the return value onto the stack.
  325. lua_pushnumber(state, result);
  326. return 1;
  327. }
  328. else
  329. {
  330. lua_pushstring(state, "lua_BoundingBox_intersects - Failed to match the given parameters to a valid function signature.");
  331. lua_error(state);
  332. }
  333. break;
  334. }
  335. default:
  336. {
  337. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  338. lua_error(state);
  339. break;
  340. }
  341. }
  342. return 0;
  343. }
  344. int lua_BoundingBox_isEmpty(lua_State* state)
  345. {
  346. // Get the number of parameters.
  347. int paramCount = lua_gettop(state);
  348. // Attempt to match the parameters to a valid binding.
  349. switch (paramCount)
  350. {
  351. case 1:
  352. {
  353. if ((lua_type(state, 1) == LUA_TUSERDATA))
  354. {
  355. BoundingBox* instance = getInstance(state);
  356. bool result = instance->isEmpty();
  357. // Push the return value onto the stack.
  358. lua_pushboolean(state, result);
  359. return 1;
  360. }
  361. else
  362. {
  363. lua_pushstring(state, "lua_BoundingBox_isEmpty - Failed to match the given parameters to a valid function signature.");
  364. lua_error(state);
  365. }
  366. break;
  367. }
  368. default:
  369. {
  370. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  371. lua_error(state);
  372. break;
  373. }
  374. }
  375. return 0;
  376. }
  377. int lua_BoundingBox_max(lua_State* state)
  378. {
  379. // Validate the number of parameters.
  380. if (lua_gettop(state) > 2)
  381. {
  382. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  383. lua_error(state);
  384. }
  385. BoundingBox* instance = getInstance(state);
  386. if (lua_gettop(state) == 2)
  387. {
  388. // Get parameter 2 off the stack.
  389. ScriptUtil::LuaArray<Vector3> param2 = ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true);
  390. instance->max = *param2;
  391. return 0;
  392. }
  393. else
  394. {
  395. void* returnPtr = (void*)new Vector3(instance->max);
  396. if (returnPtr)
  397. {
  398. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  399. object->instance = returnPtr;
  400. object->owns = true;
  401. luaL_getmetatable(state, "Vector3");
  402. lua_setmetatable(state, -2);
  403. }
  404. else
  405. {
  406. lua_pushnil(state);
  407. }
  408. return 1;
  409. }
  410. }
  411. int lua_BoundingBox_merge(lua_State* state)
  412. {
  413. // Get the number of parameters.
  414. int paramCount = lua_gettop(state);
  415. // Attempt to match the parameters to a valid binding.
  416. switch (paramCount)
  417. {
  418. case 2:
  419. {
  420. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  421. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  422. {
  423. // Get parameter 1 off the stack.
  424. ScriptUtil::LuaArray<BoundingSphere> param1 = ScriptUtil::getObjectPointer<BoundingSphere>(2, "BoundingSphere", true);
  425. BoundingBox* instance = getInstance(state);
  426. instance->merge(*param1);
  427. return 0;
  428. }
  429. else if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  430. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  431. {
  432. // Get parameter 1 off the stack.
  433. ScriptUtil::LuaArray<BoundingBox> param1 = ScriptUtil::getObjectPointer<BoundingBox>(2, "BoundingBox", true);
  434. BoundingBox* instance = getInstance(state);
  435. instance->merge(*param1);
  436. return 0;
  437. }
  438. else
  439. {
  440. lua_pushstring(state, "lua_BoundingBox_merge - Failed to match the given parameters to a valid function signature.");
  441. lua_error(state);
  442. }
  443. break;
  444. }
  445. default:
  446. {
  447. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  448. lua_error(state);
  449. break;
  450. }
  451. }
  452. return 0;
  453. }
  454. int lua_BoundingBox_min(lua_State* state)
  455. {
  456. // Validate the number of parameters.
  457. if (lua_gettop(state) > 2)
  458. {
  459. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  460. lua_error(state);
  461. }
  462. BoundingBox* instance = getInstance(state);
  463. if (lua_gettop(state) == 2)
  464. {
  465. // Get parameter 2 off the stack.
  466. ScriptUtil::LuaArray<Vector3> param2 = ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true);
  467. instance->min = *param2;
  468. return 0;
  469. }
  470. else
  471. {
  472. void* returnPtr = (void*)new Vector3(instance->min);
  473. if (returnPtr)
  474. {
  475. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  476. object->instance = returnPtr;
  477. object->owns = true;
  478. luaL_getmetatable(state, "Vector3");
  479. lua_setmetatable(state, -2);
  480. }
  481. else
  482. {
  483. lua_pushnil(state);
  484. }
  485. return 1;
  486. }
  487. }
  488. int lua_BoundingBox_set(lua_State* state)
  489. {
  490. // Get the number of parameters.
  491. int paramCount = lua_gettop(state);
  492. // Attempt to match the parameters to a valid binding.
  493. switch (paramCount)
  494. {
  495. case 2:
  496. {
  497. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  498. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  499. {
  500. // Get parameter 1 off the stack.
  501. ScriptUtil::LuaArray<BoundingBox> param1 = ScriptUtil::getObjectPointer<BoundingBox>(2, "BoundingBox", true);
  502. BoundingBox* instance = getInstance(state);
  503. instance->set(*param1);
  504. return 0;
  505. }
  506. else if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  507. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  508. {
  509. // Get parameter 1 off the stack.
  510. ScriptUtil::LuaArray<BoundingSphere> param1 = ScriptUtil::getObjectPointer<BoundingSphere>(2, "BoundingSphere", true);
  511. BoundingBox* instance = getInstance(state);
  512. instance->set(*param1);
  513. return 0;
  514. }
  515. else
  516. {
  517. lua_pushstring(state, "lua_BoundingBox_set - Failed to match the given parameters to a valid function signature.");
  518. lua_error(state);
  519. }
  520. break;
  521. }
  522. case 3:
  523. {
  524. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  525. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  526. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL))
  527. {
  528. // Get parameter 1 off the stack.
  529. ScriptUtil::LuaArray<Vector3> param1 = ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true);
  530. // Get parameter 2 off the stack.
  531. ScriptUtil::LuaArray<Vector3> param2 = ScriptUtil::getObjectPointer<Vector3>(3, "Vector3", true);
  532. BoundingBox* instance = getInstance(state);
  533. instance->set(*param1, *param2);
  534. return 0;
  535. }
  536. else
  537. {
  538. lua_pushstring(state, "lua_BoundingBox_set - Failed to match the given parameters to a valid function signature.");
  539. lua_error(state);
  540. }
  541. break;
  542. }
  543. default:
  544. {
  545. lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
  546. lua_error(state);
  547. break;
  548. }
  549. }
  550. return 0;
  551. }
  552. int lua_BoundingBox_static_empty(lua_State* state)
  553. {
  554. // Get the number of parameters.
  555. int paramCount = lua_gettop(state);
  556. // Attempt to match the parameters to a valid binding.
  557. switch (paramCount)
  558. {
  559. case 0:
  560. {
  561. void* returnPtr = (void*)&(BoundingBox::empty());
  562. if (returnPtr)
  563. {
  564. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  565. object->instance = returnPtr;
  566. object->owns = false;
  567. luaL_getmetatable(state, "BoundingBox");
  568. lua_setmetatable(state, -2);
  569. }
  570. else
  571. {
  572. lua_pushnil(state);
  573. }
  574. return 1;
  575. break;
  576. }
  577. default:
  578. {
  579. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  580. lua_error(state);
  581. break;
  582. }
  583. }
  584. return 0;
  585. }
  586. int lua_BoundingBox_transform(lua_State* state)
  587. {
  588. // Get the number of parameters.
  589. int paramCount = lua_gettop(state);
  590. // Attempt to match the parameters to a valid binding.
  591. switch (paramCount)
  592. {
  593. case 2:
  594. {
  595. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  596. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  597. {
  598. // Get parameter 1 off the stack.
  599. ScriptUtil::LuaArray<Matrix> param1 = ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", true);
  600. BoundingBox* instance = getInstance(state);
  601. instance->transform(*param1);
  602. return 0;
  603. }
  604. else
  605. {
  606. lua_pushstring(state, "lua_BoundingBox_transform - Failed to match the given parameters to a valid function signature.");
  607. lua_error(state);
  608. }
  609. break;
  610. }
  611. default:
  612. {
  613. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  614. lua_error(state);
  615. break;
  616. }
  617. }
  618. return 0;
  619. }
  620. }