lua_PhysicsSpringConstraint.cpp 43 KB

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