lua_Camera.cpp 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438
  1. #include "Base.h"
  2. #include "ScriptController.h"
  3. #include "lua_Camera.h"
  4. #include "Animation.h"
  5. #include "AnimationTarget.h"
  6. #include "Base.h"
  7. #include "Camera.h"
  8. #include "Game.h"
  9. #include "Node.h"
  10. #include "PhysicsController.h"
  11. #include "Ref.h"
  12. #include "ScriptController.h"
  13. #include "ScriptTarget.h"
  14. #include "Transform.h"
  15. #include "lua_CameraType.h"
  16. #include "lua_CurveInterpolationType.h"
  17. namespace gameplay
  18. {
  19. void luaRegister_Camera()
  20. {
  21. const luaL_Reg lua_members[] =
  22. {
  23. {"addRef", lua_Camera_addRef},
  24. {"getAspectRatio", lua_Camera_getAspectRatio},
  25. {"getCameraType", lua_Camera_getCameraType},
  26. {"getFarPlane", lua_Camera_getFarPlane},
  27. {"getFieldOfView", lua_Camera_getFieldOfView},
  28. {"getFrustum", lua_Camera_getFrustum},
  29. {"getInverseViewMatrix", lua_Camera_getInverseViewMatrix},
  30. {"getInverseViewProjectionMatrix", lua_Camera_getInverseViewProjectionMatrix},
  31. {"getNearPlane", lua_Camera_getNearPlane},
  32. {"getNode", lua_Camera_getNode},
  33. {"getProjectionMatrix", lua_Camera_getProjectionMatrix},
  34. {"getRefCount", lua_Camera_getRefCount},
  35. {"getViewMatrix", lua_Camera_getViewMatrix},
  36. {"getViewProjectionMatrix", lua_Camera_getViewProjectionMatrix},
  37. {"getZoomX", lua_Camera_getZoomX},
  38. {"getZoomY", lua_Camera_getZoomY},
  39. {"pickRay", lua_Camera_pickRay},
  40. {"project", lua_Camera_project},
  41. {"release", lua_Camera_release},
  42. {"resetProjectionMatrix", lua_Camera_resetProjectionMatrix},
  43. {"setAspectRatio", lua_Camera_setAspectRatio},
  44. {"setFarPlane", lua_Camera_setFarPlane},
  45. {"setFieldOfView", lua_Camera_setFieldOfView},
  46. {"setNearPlane", lua_Camera_setNearPlane},
  47. {"setProjectionMatrix", lua_Camera_setProjectionMatrix},
  48. {"setZoomX", lua_Camera_setZoomX},
  49. {"setZoomY", lua_Camera_setZoomY},
  50. {"unproject", lua_Camera_unproject},
  51. {NULL, NULL}
  52. };
  53. const luaL_Reg lua_statics[] =
  54. {
  55. {"create", lua_Camera_static_create},
  56. {"createOrthographic", lua_Camera_static_createOrthographic},
  57. {"createPerspective", lua_Camera_static_createPerspective},
  58. {NULL, NULL}
  59. };
  60. std::vector<std::string> scopePath;
  61. gameplay::ScriptUtil::registerClass("Camera", lua_members, NULL, lua_Camera__gc, lua_statics, scopePath);
  62. }
  63. static Camera* getInstance(lua_State* state)
  64. {
  65. void* userdata = luaL_checkudata(state, 1, "Camera");
  66. luaL_argcheck(state, userdata != NULL, 1, "'Camera' expected.");
  67. return (Camera*)((gameplay::ScriptUtil::LuaObject*)userdata)->instance;
  68. }
  69. int lua_Camera__gc(lua_State* state)
  70. {
  71. // Get the number of parameters.
  72. int paramCount = lua_gettop(state);
  73. // Attempt to match the parameters to a valid binding.
  74. switch (paramCount)
  75. {
  76. case 1:
  77. {
  78. if ((lua_type(state, 1) == LUA_TUSERDATA))
  79. {
  80. void* userdata = luaL_checkudata(state, 1, "Camera");
  81. luaL_argcheck(state, userdata != NULL, 1, "'Camera' expected.");
  82. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)userdata;
  83. if (object->owns)
  84. {
  85. Camera* instance = (Camera*)object->instance;
  86. SAFE_RELEASE(instance);
  87. }
  88. return 0;
  89. }
  90. lua_pushstring(state, "lua_Camera__gc - Failed to match the given parameters to a valid function signature.");
  91. lua_error(state);
  92. break;
  93. }
  94. default:
  95. {
  96. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  97. lua_error(state);
  98. break;
  99. }
  100. }
  101. return 0;
  102. }
  103. int lua_Camera_addRef(lua_State* state)
  104. {
  105. // Get the number of parameters.
  106. int paramCount = lua_gettop(state);
  107. // Attempt to match the parameters to a valid binding.
  108. switch (paramCount)
  109. {
  110. case 1:
  111. {
  112. if ((lua_type(state, 1) == LUA_TUSERDATA))
  113. {
  114. Camera* instance = getInstance(state);
  115. instance->addRef();
  116. return 0;
  117. }
  118. lua_pushstring(state, "lua_Camera_addRef - Failed to match the given parameters to a valid function signature.");
  119. lua_error(state);
  120. break;
  121. }
  122. default:
  123. {
  124. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  125. lua_error(state);
  126. break;
  127. }
  128. }
  129. return 0;
  130. }
  131. int lua_Camera_getAspectRatio(lua_State* state)
  132. {
  133. // Get the number of parameters.
  134. int paramCount = lua_gettop(state);
  135. // Attempt to match the parameters to a valid binding.
  136. switch (paramCount)
  137. {
  138. case 1:
  139. {
  140. if ((lua_type(state, 1) == LUA_TUSERDATA))
  141. {
  142. Camera* instance = getInstance(state);
  143. float result = instance->getAspectRatio();
  144. // Push the return value onto the stack.
  145. lua_pushnumber(state, result);
  146. return 1;
  147. }
  148. lua_pushstring(state, "lua_Camera_getAspectRatio - Failed to match the given parameters to a valid function signature.");
  149. lua_error(state);
  150. break;
  151. }
  152. default:
  153. {
  154. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  155. lua_error(state);
  156. break;
  157. }
  158. }
  159. return 0;
  160. }
  161. int lua_Camera_getCameraType(lua_State* state)
  162. {
  163. // Get the number of parameters.
  164. int paramCount = lua_gettop(state);
  165. // Attempt to match the parameters to a valid binding.
  166. switch (paramCount)
  167. {
  168. case 1:
  169. {
  170. if ((lua_type(state, 1) == LUA_TUSERDATA))
  171. {
  172. Camera* instance = getInstance(state);
  173. Camera::Type result = instance->getCameraType();
  174. // Push the return value onto the stack.
  175. lua_pushstring(state, lua_stringFromEnum_CameraType(result));
  176. return 1;
  177. }
  178. lua_pushstring(state, "lua_Camera_getCameraType - Failed to match the given parameters to a valid function signature.");
  179. lua_error(state);
  180. break;
  181. }
  182. default:
  183. {
  184. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  185. lua_error(state);
  186. break;
  187. }
  188. }
  189. return 0;
  190. }
  191. int lua_Camera_getFarPlane(lua_State* state)
  192. {
  193. // Get the number of parameters.
  194. int paramCount = lua_gettop(state);
  195. // Attempt to match the parameters to a valid binding.
  196. switch (paramCount)
  197. {
  198. case 1:
  199. {
  200. if ((lua_type(state, 1) == LUA_TUSERDATA))
  201. {
  202. Camera* instance = getInstance(state);
  203. float result = instance->getFarPlane();
  204. // Push the return value onto the stack.
  205. lua_pushnumber(state, result);
  206. return 1;
  207. }
  208. lua_pushstring(state, "lua_Camera_getFarPlane - Failed to match the given parameters to a valid function signature.");
  209. lua_error(state);
  210. break;
  211. }
  212. default:
  213. {
  214. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  215. lua_error(state);
  216. break;
  217. }
  218. }
  219. return 0;
  220. }
  221. int lua_Camera_getFieldOfView(lua_State* state)
  222. {
  223. // Get the number of parameters.
  224. int paramCount = lua_gettop(state);
  225. // Attempt to match the parameters to a valid binding.
  226. switch (paramCount)
  227. {
  228. case 1:
  229. {
  230. if ((lua_type(state, 1) == LUA_TUSERDATA))
  231. {
  232. Camera* instance = getInstance(state);
  233. float result = instance->getFieldOfView();
  234. // Push the return value onto the stack.
  235. lua_pushnumber(state, result);
  236. return 1;
  237. }
  238. lua_pushstring(state, "lua_Camera_getFieldOfView - Failed to match the given parameters to a valid function signature.");
  239. lua_error(state);
  240. break;
  241. }
  242. default:
  243. {
  244. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  245. lua_error(state);
  246. break;
  247. }
  248. }
  249. return 0;
  250. }
  251. int lua_Camera_getFrustum(lua_State* state)
  252. {
  253. // Get the number of parameters.
  254. int paramCount = lua_gettop(state);
  255. // Attempt to match the parameters to a valid binding.
  256. switch (paramCount)
  257. {
  258. case 1:
  259. {
  260. if ((lua_type(state, 1) == LUA_TUSERDATA))
  261. {
  262. Camera* instance = getInstance(state);
  263. void* returnPtr = (void*)&(instance->getFrustum());
  264. if (returnPtr)
  265. {
  266. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  267. object->instance = returnPtr;
  268. object->owns = false;
  269. luaL_getmetatable(state, "Frustum");
  270. lua_setmetatable(state, -2);
  271. }
  272. else
  273. {
  274. lua_pushnil(state);
  275. }
  276. return 1;
  277. }
  278. lua_pushstring(state, "lua_Camera_getFrustum - Failed to match the given parameters to a valid function signature.");
  279. lua_error(state);
  280. break;
  281. }
  282. default:
  283. {
  284. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  285. lua_error(state);
  286. break;
  287. }
  288. }
  289. return 0;
  290. }
  291. int lua_Camera_getInverseViewMatrix(lua_State* state)
  292. {
  293. // Get the number of parameters.
  294. int paramCount = lua_gettop(state);
  295. // Attempt to match the parameters to a valid binding.
  296. switch (paramCount)
  297. {
  298. case 1:
  299. {
  300. if ((lua_type(state, 1) == LUA_TUSERDATA))
  301. {
  302. Camera* instance = getInstance(state);
  303. void* returnPtr = (void*)&(instance->getInverseViewMatrix());
  304. if (returnPtr)
  305. {
  306. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  307. object->instance = returnPtr;
  308. object->owns = false;
  309. luaL_getmetatable(state, "Matrix");
  310. lua_setmetatable(state, -2);
  311. }
  312. else
  313. {
  314. lua_pushnil(state);
  315. }
  316. return 1;
  317. }
  318. lua_pushstring(state, "lua_Camera_getInverseViewMatrix - Failed to match the given parameters to a valid function signature.");
  319. lua_error(state);
  320. break;
  321. }
  322. default:
  323. {
  324. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  325. lua_error(state);
  326. break;
  327. }
  328. }
  329. return 0;
  330. }
  331. int lua_Camera_getInverseViewProjectionMatrix(lua_State* state)
  332. {
  333. // Get the number of parameters.
  334. int paramCount = lua_gettop(state);
  335. // Attempt to match the parameters to a valid binding.
  336. switch (paramCount)
  337. {
  338. case 1:
  339. {
  340. if ((lua_type(state, 1) == LUA_TUSERDATA))
  341. {
  342. Camera* instance = getInstance(state);
  343. void* returnPtr = (void*)&(instance->getInverseViewProjectionMatrix());
  344. if (returnPtr)
  345. {
  346. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  347. object->instance = returnPtr;
  348. object->owns = false;
  349. luaL_getmetatable(state, "Matrix");
  350. lua_setmetatable(state, -2);
  351. }
  352. else
  353. {
  354. lua_pushnil(state);
  355. }
  356. return 1;
  357. }
  358. lua_pushstring(state, "lua_Camera_getInverseViewProjectionMatrix - Failed to match the given parameters to a valid function signature.");
  359. lua_error(state);
  360. break;
  361. }
  362. default:
  363. {
  364. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  365. lua_error(state);
  366. break;
  367. }
  368. }
  369. return 0;
  370. }
  371. int lua_Camera_getNearPlane(lua_State* state)
  372. {
  373. // Get the number of parameters.
  374. int paramCount = lua_gettop(state);
  375. // Attempt to match the parameters to a valid binding.
  376. switch (paramCount)
  377. {
  378. case 1:
  379. {
  380. if ((lua_type(state, 1) == LUA_TUSERDATA))
  381. {
  382. Camera* instance = getInstance(state);
  383. float result = instance->getNearPlane();
  384. // Push the return value onto the stack.
  385. lua_pushnumber(state, result);
  386. return 1;
  387. }
  388. lua_pushstring(state, "lua_Camera_getNearPlane - Failed to match the given parameters to a valid function signature.");
  389. lua_error(state);
  390. break;
  391. }
  392. default:
  393. {
  394. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  395. lua_error(state);
  396. break;
  397. }
  398. }
  399. return 0;
  400. }
  401. int lua_Camera_getNode(lua_State* state)
  402. {
  403. // Get the number of parameters.
  404. int paramCount = lua_gettop(state);
  405. // Attempt to match the parameters to a valid binding.
  406. switch (paramCount)
  407. {
  408. case 1:
  409. {
  410. if ((lua_type(state, 1) == LUA_TUSERDATA))
  411. {
  412. Camera* instance = getInstance(state);
  413. void* returnPtr = (void*)instance->getNode();
  414. if (returnPtr)
  415. {
  416. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  417. object->instance = returnPtr;
  418. object->owns = false;
  419. luaL_getmetatable(state, "Node");
  420. lua_setmetatable(state, -2);
  421. }
  422. else
  423. {
  424. lua_pushnil(state);
  425. }
  426. return 1;
  427. }
  428. lua_pushstring(state, "lua_Camera_getNode - Failed to match the given parameters to a valid function signature.");
  429. lua_error(state);
  430. break;
  431. }
  432. default:
  433. {
  434. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  435. lua_error(state);
  436. break;
  437. }
  438. }
  439. return 0;
  440. }
  441. int lua_Camera_getProjectionMatrix(lua_State* state)
  442. {
  443. // Get the number of parameters.
  444. int paramCount = lua_gettop(state);
  445. // Attempt to match the parameters to a valid binding.
  446. switch (paramCount)
  447. {
  448. case 1:
  449. {
  450. if ((lua_type(state, 1) == LUA_TUSERDATA))
  451. {
  452. Camera* instance = getInstance(state);
  453. void* returnPtr = (void*)&(instance->getProjectionMatrix());
  454. if (returnPtr)
  455. {
  456. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  457. object->instance = returnPtr;
  458. object->owns = false;
  459. luaL_getmetatable(state, "Matrix");
  460. lua_setmetatable(state, -2);
  461. }
  462. else
  463. {
  464. lua_pushnil(state);
  465. }
  466. return 1;
  467. }
  468. lua_pushstring(state, "lua_Camera_getProjectionMatrix - Failed to match the given parameters to a valid function signature.");
  469. lua_error(state);
  470. break;
  471. }
  472. default:
  473. {
  474. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  475. lua_error(state);
  476. break;
  477. }
  478. }
  479. return 0;
  480. }
  481. int lua_Camera_getRefCount(lua_State* state)
  482. {
  483. // Get the number of parameters.
  484. int paramCount = lua_gettop(state);
  485. // Attempt to match the parameters to a valid binding.
  486. switch (paramCount)
  487. {
  488. case 1:
  489. {
  490. if ((lua_type(state, 1) == LUA_TUSERDATA))
  491. {
  492. Camera* instance = getInstance(state);
  493. unsigned int result = instance->getRefCount();
  494. // Push the return value onto the stack.
  495. lua_pushunsigned(state, result);
  496. return 1;
  497. }
  498. lua_pushstring(state, "lua_Camera_getRefCount - Failed to match the given parameters to a valid function signature.");
  499. lua_error(state);
  500. break;
  501. }
  502. default:
  503. {
  504. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  505. lua_error(state);
  506. break;
  507. }
  508. }
  509. return 0;
  510. }
  511. int lua_Camera_getViewMatrix(lua_State* state)
  512. {
  513. // Get the number of parameters.
  514. int paramCount = lua_gettop(state);
  515. // Attempt to match the parameters to a valid binding.
  516. switch (paramCount)
  517. {
  518. case 1:
  519. {
  520. if ((lua_type(state, 1) == LUA_TUSERDATA))
  521. {
  522. Camera* instance = getInstance(state);
  523. void* returnPtr = (void*)&(instance->getViewMatrix());
  524. if (returnPtr)
  525. {
  526. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  527. object->instance = returnPtr;
  528. object->owns = false;
  529. luaL_getmetatable(state, "Matrix");
  530. lua_setmetatable(state, -2);
  531. }
  532. else
  533. {
  534. lua_pushnil(state);
  535. }
  536. return 1;
  537. }
  538. lua_pushstring(state, "lua_Camera_getViewMatrix - Failed to match the given parameters to a valid function signature.");
  539. lua_error(state);
  540. break;
  541. }
  542. default:
  543. {
  544. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  545. lua_error(state);
  546. break;
  547. }
  548. }
  549. return 0;
  550. }
  551. int lua_Camera_getViewProjectionMatrix(lua_State* state)
  552. {
  553. // Get the number of parameters.
  554. int paramCount = lua_gettop(state);
  555. // Attempt to match the parameters to a valid binding.
  556. switch (paramCount)
  557. {
  558. case 1:
  559. {
  560. if ((lua_type(state, 1) == LUA_TUSERDATA))
  561. {
  562. Camera* instance = getInstance(state);
  563. void* returnPtr = (void*)&(instance->getViewProjectionMatrix());
  564. if (returnPtr)
  565. {
  566. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  567. object->instance = returnPtr;
  568. object->owns = false;
  569. luaL_getmetatable(state, "Matrix");
  570. lua_setmetatable(state, -2);
  571. }
  572. else
  573. {
  574. lua_pushnil(state);
  575. }
  576. return 1;
  577. }
  578. lua_pushstring(state, "lua_Camera_getViewProjectionMatrix - Failed to match the given parameters to a valid function signature.");
  579. lua_error(state);
  580. break;
  581. }
  582. default:
  583. {
  584. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  585. lua_error(state);
  586. break;
  587. }
  588. }
  589. return 0;
  590. }
  591. int lua_Camera_getZoomX(lua_State* state)
  592. {
  593. // Get the number of parameters.
  594. int paramCount = lua_gettop(state);
  595. // Attempt to match the parameters to a valid binding.
  596. switch (paramCount)
  597. {
  598. case 1:
  599. {
  600. if ((lua_type(state, 1) == LUA_TUSERDATA))
  601. {
  602. Camera* instance = getInstance(state);
  603. float result = instance->getZoomX();
  604. // Push the return value onto the stack.
  605. lua_pushnumber(state, result);
  606. return 1;
  607. }
  608. lua_pushstring(state, "lua_Camera_getZoomX - Failed to match the given parameters to a valid function signature.");
  609. lua_error(state);
  610. break;
  611. }
  612. default:
  613. {
  614. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  615. lua_error(state);
  616. break;
  617. }
  618. }
  619. return 0;
  620. }
  621. int lua_Camera_getZoomY(lua_State* state)
  622. {
  623. // Get the number of parameters.
  624. int paramCount = lua_gettop(state);
  625. // Attempt to match the parameters to a valid binding.
  626. switch (paramCount)
  627. {
  628. case 1:
  629. {
  630. if ((lua_type(state, 1) == LUA_TUSERDATA))
  631. {
  632. Camera* instance = getInstance(state);
  633. float result = instance->getZoomY();
  634. // Push the return value onto the stack.
  635. lua_pushnumber(state, result);
  636. return 1;
  637. }
  638. lua_pushstring(state, "lua_Camera_getZoomY - Failed to match the given parameters to a valid function signature.");
  639. lua_error(state);
  640. break;
  641. }
  642. default:
  643. {
  644. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  645. lua_error(state);
  646. break;
  647. }
  648. }
  649. return 0;
  650. }
  651. int lua_Camera_pickRay(lua_State* state)
  652. {
  653. // Get the number of parameters.
  654. int paramCount = lua_gettop(state);
  655. // Attempt to match the parameters to a valid binding.
  656. switch (paramCount)
  657. {
  658. case 5:
  659. {
  660. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  661. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  662. lua_type(state, 3) == LUA_TNUMBER &&
  663. lua_type(state, 4) == LUA_TNUMBER &&
  664. (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TNIL))
  665. {
  666. // Get parameter 1 off the stack.
  667. bool param1Valid;
  668. gameplay::ScriptUtil::LuaArray<Rectangle> param1 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(2, "Rectangle", true, &param1Valid);
  669. if (!param1Valid)
  670. {
  671. lua_pushstring(state, "Failed to convert parameter 1 to type 'Rectangle'.");
  672. lua_error(state);
  673. }
  674. // Get parameter 2 off the stack.
  675. float param2 = (float)luaL_checknumber(state, 3);
  676. // Get parameter 3 off the stack.
  677. float param3 = (float)luaL_checknumber(state, 4);
  678. // Get parameter 4 off the stack.
  679. bool param4Valid;
  680. gameplay::ScriptUtil::LuaArray<Ray> param4 = gameplay::ScriptUtil::getObjectPointer<Ray>(5, "Ray", false, &param4Valid);
  681. if (!param4Valid)
  682. {
  683. lua_pushstring(state, "Failed to convert parameter 4 to type 'Ray'.");
  684. lua_error(state);
  685. }
  686. Camera* instance = getInstance(state);
  687. instance->pickRay(*param1, param2, param3, param4);
  688. return 0;
  689. }
  690. lua_pushstring(state, "lua_Camera_pickRay - Failed to match the given parameters to a valid function signature.");
  691. lua_error(state);
  692. break;
  693. }
  694. default:
  695. {
  696. lua_pushstring(state, "Invalid number of parameters (expected 5).");
  697. lua_error(state);
  698. break;
  699. }
  700. }
  701. return 0;
  702. }
  703. int lua_Camera_project(lua_State* state)
  704. {
  705. // Get the number of parameters.
  706. int paramCount = lua_gettop(state);
  707. // Attempt to match the parameters to a valid binding.
  708. switch (paramCount)
  709. {
  710. case 4:
  711. {
  712. do
  713. {
  714. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  715. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  716. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  717. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TNIL))
  718. {
  719. // Get parameter 1 off the stack.
  720. bool param1Valid;
  721. gameplay::ScriptUtil::LuaArray<Rectangle> param1 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(2, "Rectangle", true, &param1Valid);
  722. if (!param1Valid)
  723. break;
  724. // Get parameter 2 off the stack.
  725. bool param2Valid;
  726. gameplay::ScriptUtil::LuaArray<Vector3> param2 = gameplay::ScriptUtil::getObjectPointer<Vector3>(3, "Vector3", true, &param2Valid);
  727. if (!param2Valid)
  728. break;
  729. // Get parameter 3 off the stack.
  730. bool param3Valid;
  731. gameplay::ScriptUtil::LuaArray<Vector2> param3 = gameplay::ScriptUtil::getObjectPointer<Vector2>(4, "Vector2", false, &param3Valid);
  732. if (!param3Valid)
  733. break;
  734. Camera* instance = getInstance(state);
  735. instance->project(*param1, *param2, param3);
  736. return 0;
  737. }
  738. } while (0);
  739. do
  740. {
  741. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  742. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  743. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  744. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TNIL))
  745. {
  746. // Get parameter 1 off the stack.
  747. bool param1Valid;
  748. gameplay::ScriptUtil::LuaArray<Rectangle> param1 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(2, "Rectangle", true, &param1Valid);
  749. if (!param1Valid)
  750. break;
  751. // Get parameter 2 off the stack.
  752. bool param2Valid;
  753. gameplay::ScriptUtil::LuaArray<Vector3> param2 = gameplay::ScriptUtil::getObjectPointer<Vector3>(3, "Vector3", true, &param2Valid);
  754. if (!param2Valid)
  755. break;
  756. // Get parameter 3 off the stack.
  757. bool param3Valid;
  758. gameplay::ScriptUtil::LuaArray<Vector3> param3 = gameplay::ScriptUtil::getObjectPointer<Vector3>(4, "Vector3", false, &param3Valid);
  759. if (!param3Valid)
  760. break;
  761. Camera* instance = getInstance(state);
  762. instance->project(*param1, *param2, param3);
  763. return 0;
  764. }
  765. } while (0);
  766. lua_pushstring(state, "lua_Camera_project - Failed to match the given parameters to a valid function signature.");
  767. lua_error(state);
  768. break;
  769. }
  770. default:
  771. {
  772. lua_pushstring(state, "Invalid number of parameters (expected 4).");
  773. lua_error(state);
  774. break;
  775. }
  776. }
  777. return 0;
  778. }
  779. int lua_Camera_release(lua_State* state)
  780. {
  781. // Get the number of parameters.
  782. int paramCount = lua_gettop(state);
  783. // Attempt to match the parameters to a valid binding.
  784. switch (paramCount)
  785. {
  786. case 1:
  787. {
  788. if ((lua_type(state, 1) == LUA_TUSERDATA))
  789. {
  790. Camera* instance = getInstance(state);
  791. instance->release();
  792. return 0;
  793. }
  794. lua_pushstring(state, "lua_Camera_release - Failed to match the given parameters to a valid function signature.");
  795. lua_error(state);
  796. break;
  797. }
  798. default:
  799. {
  800. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  801. lua_error(state);
  802. break;
  803. }
  804. }
  805. return 0;
  806. }
  807. int lua_Camera_resetProjectionMatrix(lua_State* state)
  808. {
  809. // Get the number of parameters.
  810. int paramCount = lua_gettop(state);
  811. // Attempt to match the parameters to a valid binding.
  812. switch (paramCount)
  813. {
  814. case 1:
  815. {
  816. if ((lua_type(state, 1) == LUA_TUSERDATA))
  817. {
  818. Camera* instance = getInstance(state);
  819. instance->resetProjectionMatrix();
  820. return 0;
  821. }
  822. lua_pushstring(state, "lua_Camera_resetProjectionMatrix - Failed to match the given parameters to a valid function signature.");
  823. lua_error(state);
  824. break;
  825. }
  826. default:
  827. {
  828. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  829. lua_error(state);
  830. break;
  831. }
  832. }
  833. return 0;
  834. }
  835. int lua_Camera_setAspectRatio(lua_State* state)
  836. {
  837. // Get the number of parameters.
  838. int paramCount = lua_gettop(state);
  839. // Attempt to match the parameters to a valid binding.
  840. switch (paramCount)
  841. {
  842. case 2:
  843. {
  844. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  845. lua_type(state, 2) == LUA_TNUMBER)
  846. {
  847. // Get parameter 1 off the stack.
  848. float param1 = (float)luaL_checknumber(state, 2);
  849. Camera* instance = getInstance(state);
  850. instance->setAspectRatio(param1);
  851. return 0;
  852. }
  853. lua_pushstring(state, "lua_Camera_setAspectRatio - Failed to match the given parameters to a valid function signature.");
  854. lua_error(state);
  855. break;
  856. }
  857. default:
  858. {
  859. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  860. lua_error(state);
  861. break;
  862. }
  863. }
  864. return 0;
  865. }
  866. int lua_Camera_setFarPlane(lua_State* state)
  867. {
  868. // Get the number of parameters.
  869. int paramCount = lua_gettop(state);
  870. // Attempt to match the parameters to a valid binding.
  871. switch (paramCount)
  872. {
  873. case 2:
  874. {
  875. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  876. lua_type(state, 2) == LUA_TNUMBER)
  877. {
  878. // Get parameter 1 off the stack.
  879. float param1 = (float)luaL_checknumber(state, 2);
  880. Camera* instance = getInstance(state);
  881. instance->setFarPlane(param1);
  882. return 0;
  883. }
  884. lua_pushstring(state, "lua_Camera_setFarPlane - Failed to match the given parameters to a valid function signature.");
  885. lua_error(state);
  886. break;
  887. }
  888. default:
  889. {
  890. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  891. lua_error(state);
  892. break;
  893. }
  894. }
  895. return 0;
  896. }
  897. int lua_Camera_setFieldOfView(lua_State* state)
  898. {
  899. // Get the number of parameters.
  900. int paramCount = lua_gettop(state);
  901. // Attempt to match the parameters to a valid binding.
  902. switch (paramCount)
  903. {
  904. case 2:
  905. {
  906. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  907. lua_type(state, 2) == LUA_TNUMBER)
  908. {
  909. // Get parameter 1 off the stack.
  910. float param1 = (float)luaL_checknumber(state, 2);
  911. Camera* instance = getInstance(state);
  912. instance->setFieldOfView(param1);
  913. return 0;
  914. }
  915. lua_pushstring(state, "lua_Camera_setFieldOfView - Failed to match the given parameters to a valid function signature.");
  916. lua_error(state);
  917. break;
  918. }
  919. default:
  920. {
  921. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  922. lua_error(state);
  923. break;
  924. }
  925. }
  926. return 0;
  927. }
  928. int lua_Camera_setNearPlane(lua_State* state)
  929. {
  930. // Get the number of parameters.
  931. int paramCount = lua_gettop(state);
  932. // Attempt to match the parameters to a valid binding.
  933. switch (paramCount)
  934. {
  935. case 2:
  936. {
  937. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  938. lua_type(state, 2) == LUA_TNUMBER)
  939. {
  940. // Get parameter 1 off the stack.
  941. float param1 = (float)luaL_checknumber(state, 2);
  942. Camera* instance = getInstance(state);
  943. instance->setNearPlane(param1);
  944. return 0;
  945. }
  946. lua_pushstring(state, "lua_Camera_setNearPlane - Failed to match the given parameters to a valid function signature.");
  947. lua_error(state);
  948. break;
  949. }
  950. default:
  951. {
  952. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  953. lua_error(state);
  954. break;
  955. }
  956. }
  957. return 0;
  958. }
  959. int lua_Camera_setProjectionMatrix(lua_State* state)
  960. {
  961. // Get the number of parameters.
  962. int paramCount = lua_gettop(state);
  963. // Attempt to match the parameters to a valid binding.
  964. switch (paramCount)
  965. {
  966. case 2:
  967. {
  968. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  969. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  970. {
  971. // Get parameter 1 off the stack.
  972. bool param1Valid;
  973. gameplay::ScriptUtil::LuaArray<Matrix> param1 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", true, &param1Valid);
  974. if (!param1Valid)
  975. {
  976. lua_pushstring(state, "Failed to convert parameter 1 to type 'Matrix'.");
  977. lua_error(state);
  978. }
  979. Camera* instance = getInstance(state);
  980. instance->setProjectionMatrix(*param1);
  981. return 0;
  982. }
  983. lua_pushstring(state, "lua_Camera_setProjectionMatrix - Failed to match the given parameters to a valid function signature.");
  984. lua_error(state);
  985. break;
  986. }
  987. default:
  988. {
  989. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  990. lua_error(state);
  991. break;
  992. }
  993. }
  994. return 0;
  995. }
  996. int lua_Camera_setZoomX(lua_State* state)
  997. {
  998. // Get the number of parameters.
  999. int paramCount = lua_gettop(state);
  1000. // Attempt to match the parameters to a valid binding.
  1001. switch (paramCount)
  1002. {
  1003. case 2:
  1004. {
  1005. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1006. lua_type(state, 2) == LUA_TNUMBER)
  1007. {
  1008. // Get parameter 1 off the stack.
  1009. float param1 = (float)luaL_checknumber(state, 2);
  1010. Camera* instance = getInstance(state);
  1011. instance->setZoomX(param1);
  1012. return 0;
  1013. }
  1014. lua_pushstring(state, "lua_Camera_setZoomX - Failed to match the given parameters to a valid function signature.");
  1015. lua_error(state);
  1016. break;
  1017. }
  1018. default:
  1019. {
  1020. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  1021. lua_error(state);
  1022. break;
  1023. }
  1024. }
  1025. return 0;
  1026. }
  1027. int lua_Camera_setZoomY(lua_State* state)
  1028. {
  1029. // Get the number of parameters.
  1030. int paramCount = lua_gettop(state);
  1031. // Attempt to match the parameters to a valid binding.
  1032. switch (paramCount)
  1033. {
  1034. case 2:
  1035. {
  1036. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1037. lua_type(state, 2) == LUA_TNUMBER)
  1038. {
  1039. // Get parameter 1 off the stack.
  1040. float param1 = (float)luaL_checknumber(state, 2);
  1041. Camera* instance = getInstance(state);
  1042. instance->setZoomY(param1);
  1043. return 0;
  1044. }
  1045. lua_pushstring(state, "lua_Camera_setZoomY - Failed to match the given parameters to a valid function signature.");
  1046. lua_error(state);
  1047. break;
  1048. }
  1049. default:
  1050. {
  1051. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  1052. lua_error(state);
  1053. break;
  1054. }
  1055. }
  1056. return 0;
  1057. }
  1058. int lua_Camera_static_create(lua_State* state)
  1059. {
  1060. // Get the number of parameters.
  1061. int paramCount = lua_gettop(state);
  1062. // Attempt to match the parameters to a valid binding.
  1063. switch (paramCount)
  1064. {
  1065. case 1:
  1066. {
  1067. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TTABLE || lua_type(state, 1) == LUA_TNIL))
  1068. {
  1069. // Get parameter 1 off the stack.
  1070. bool param1Valid;
  1071. gameplay::ScriptUtil::LuaArray<Properties> param1 = gameplay::ScriptUtil::getObjectPointer<Properties>(1, "Properties", false, &param1Valid);
  1072. if (!param1Valid)
  1073. {
  1074. lua_pushstring(state, "Failed to convert parameter 1 to type 'Properties'.");
  1075. lua_error(state);
  1076. }
  1077. void* returnPtr = (void*)Camera::create(param1);
  1078. if (returnPtr)
  1079. {
  1080. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  1081. object->instance = returnPtr;
  1082. object->owns = false;
  1083. luaL_getmetatable(state, "Camera");
  1084. lua_setmetatable(state, -2);
  1085. }
  1086. else
  1087. {
  1088. lua_pushnil(state);
  1089. }
  1090. return 1;
  1091. }
  1092. lua_pushstring(state, "lua_Camera_static_create - Failed to match the given parameters to a valid function signature.");
  1093. lua_error(state);
  1094. break;
  1095. }
  1096. default:
  1097. {
  1098. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1099. lua_error(state);
  1100. break;
  1101. }
  1102. }
  1103. return 0;
  1104. }
  1105. int lua_Camera_static_createOrthographic(lua_State* state)
  1106. {
  1107. // Get the number of parameters.
  1108. int paramCount = lua_gettop(state);
  1109. // Attempt to match the parameters to a valid binding.
  1110. switch (paramCount)
  1111. {
  1112. case 5:
  1113. {
  1114. if (lua_type(state, 1) == LUA_TNUMBER &&
  1115. lua_type(state, 2) == LUA_TNUMBER &&
  1116. lua_type(state, 3) == LUA_TNUMBER &&
  1117. lua_type(state, 4) == LUA_TNUMBER &&
  1118. lua_type(state, 5) == LUA_TNUMBER)
  1119. {
  1120. // Get parameter 1 off the stack.
  1121. float param1 = (float)luaL_checknumber(state, 1);
  1122. // Get parameter 2 off the stack.
  1123. float param2 = (float)luaL_checknumber(state, 2);
  1124. // Get parameter 3 off the stack.
  1125. float param3 = (float)luaL_checknumber(state, 3);
  1126. // Get parameter 4 off the stack.
  1127. float param4 = (float)luaL_checknumber(state, 4);
  1128. // Get parameter 5 off the stack.
  1129. float param5 = (float)luaL_checknumber(state, 5);
  1130. void* returnPtr = (void*)Camera::createOrthographic(param1, param2, param3, param4, param5);
  1131. if (returnPtr)
  1132. {
  1133. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  1134. object->instance = returnPtr;
  1135. object->owns = false;
  1136. luaL_getmetatable(state, "Camera");
  1137. lua_setmetatable(state, -2);
  1138. }
  1139. else
  1140. {
  1141. lua_pushnil(state);
  1142. }
  1143. return 1;
  1144. }
  1145. lua_pushstring(state, "lua_Camera_static_createOrthographic - Failed to match the given parameters to a valid function signature.");
  1146. lua_error(state);
  1147. break;
  1148. }
  1149. default:
  1150. {
  1151. lua_pushstring(state, "Invalid number of parameters (expected 5).");
  1152. lua_error(state);
  1153. break;
  1154. }
  1155. }
  1156. return 0;
  1157. }
  1158. int lua_Camera_static_createPerspective(lua_State* state)
  1159. {
  1160. // Get the number of parameters.
  1161. int paramCount = lua_gettop(state);
  1162. // Attempt to match the parameters to a valid binding.
  1163. switch (paramCount)
  1164. {
  1165. case 4:
  1166. {
  1167. if (lua_type(state, 1) == LUA_TNUMBER &&
  1168. lua_type(state, 2) == LUA_TNUMBER &&
  1169. lua_type(state, 3) == LUA_TNUMBER &&
  1170. lua_type(state, 4) == LUA_TNUMBER)
  1171. {
  1172. // Get parameter 1 off the stack.
  1173. float param1 = (float)luaL_checknumber(state, 1);
  1174. // Get parameter 2 off the stack.
  1175. float param2 = (float)luaL_checknumber(state, 2);
  1176. // Get parameter 3 off the stack.
  1177. float param3 = (float)luaL_checknumber(state, 3);
  1178. // Get parameter 4 off the stack.
  1179. float param4 = (float)luaL_checknumber(state, 4);
  1180. void* returnPtr = (void*)Camera::createPerspective(param1, param2, param3, param4);
  1181. if (returnPtr)
  1182. {
  1183. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  1184. object->instance = returnPtr;
  1185. object->owns = false;
  1186. luaL_getmetatable(state, "Camera");
  1187. lua_setmetatable(state, -2);
  1188. }
  1189. else
  1190. {
  1191. lua_pushnil(state);
  1192. }
  1193. return 1;
  1194. }
  1195. lua_pushstring(state, "lua_Camera_static_createPerspective - Failed to match the given parameters to a valid function signature.");
  1196. lua_error(state);
  1197. break;
  1198. }
  1199. default:
  1200. {
  1201. lua_pushstring(state, "Invalid number of parameters (expected 4).");
  1202. lua_error(state);
  1203. break;
  1204. }
  1205. }
  1206. return 0;
  1207. }
  1208. int lua_Camera_unproject(lua_State* state)
  1209. {
  1210. // Get the number of parameters.
  1211. int paramCount = lua_gettop(state);
  1212. // Attempt to match the parameters to a valid binding.
  1213. switch (paramCount)
  1214. {
  1215. case 6:
  1216. {
  1217. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1218. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  1219. lua_type(state, 3) == LUA_TNUMBER &&
  1220. lua_type(state, 4) == LUA_TNUMBER &&
  1221. lua_type(state, 5) == LUA_TNUMBER &&
  1222. (lua_type(state, 6) == LUA_TUSERDATA || lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TNIL))
  1223. {
  1224. // Get parameter 1 off the stack.
  1225. bool param1Valid;
  1226. gameplay::ScriptUtil::LuaArray<Rectangle> param1 = gameplay::ScriptUtil::getObjectPointer<Rectangle>(2, "Rectangle", true, &param1Valid);
  1227. if (!param1Valid)
  1228. {
  1229. lua_pushstring(state, "Failed to convert parameter 1 to type 'Rectangle'.");
  1230. lua_error(state);
  1231. }
  1232. // Get parameter 2 off the stack.
  1233. float param2 = (float)luaL_checknumber(state, 3);
  1234. // Get parameter 3 off the stack.
  1235. float param3 = (float)luaL_checknumber(state, 4);
  1236. // Get parameter 4 off the stack.
  1237. float param4 = (float)luaL_checknumber(state, 5);
  1238. // Get parameter 5 off the stack.
  1239. bool param5Valid;
  1240. gameplay::ScriptUtil::LuaArray<Vector3> param5 = gameplay::ScriptUtil::getObjectPointer<Vector3>(6, "Vector3", false, &param5Valid);
  1241. if (!param5Valid)
  1242. {
  1243. lua_pushstring(state, "Failed to convert parameter 5 to type 'Vector3'.");
  1244. lua_error(state);
  1245. }
  1246. Camera* instance = getInstance(state);
  1247. instance->unproject(*param1, param2, param3, param4, param5);
  1248. return 0;
  1249. }
  1250. lua_pushstring(state, "lua_Camera_unproject - Failed to match the given parameters to a valid function signature.");
  1251. lua_error(state);
  1252. break;
  1253. }
  1254. default:
  1255. {
  1256. lua_pushstring(state, "Invalid number of parameters (expected 6).");
  1257. lua_error(state);
  1258. break;
  1259. }
  1260. }
  1261. return 0;
  1262. }
  1263. }