lua_PhysicsGhostObject.cpp 24 KB

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