lua_PhysicsRigidBody.cpp 73 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200
  1. // Autogenerated by gameplay-luagen
  2. #include "Base.h"
  3. #include "ScriptController.h"
  4. #include "lua_PhysicsRigidBody.h"
  5. #include "Animation.h"
  6. #include "AnimationTarget.h"
  7. #include "Base.h"
  8. #include "Game.h"
  9. #include "Image.h"
  10. #include "MeshPart.h"
  11. #include "Node.h"
  12. #include "PhysicsCharacter.h"
  13. #include "PhysicsCollisionObject.h"
  14. #include "PhysicsController.h"
  15. #include "PhysicsGhostObject.h"
  16. #include "PhysicsRigidBody.h"
  17. #include "PhysicsVehicle.h"
  18. #include "PhysicsVehicleWheel.h"
  19. #include "ScriptController.h"
  20. #include "ScriptTarget.h"
  21. #include "Terrain.h"
  22. #include "Transform.h"
  23. namespace gameplay
  24. {
  25. void luaRegister_PhysicsRigidBody()
  26. {
  27. const luaL_Reg lua_members[] =
  28. {
  29. {"addCollisionListener", lua_PhysicsRigidBody_addCollisionListener},
  30. {"applyForce", lua_PhysicsRigidBody_applyForce},
  31. {"applyImpulse", lua_PhysicsRigidBody_applyImpulse},
  32. {"applyTorque", lua_PhysicsRigidBody_applyTorque},
  33. {"applyTorqueImpulse", lua_PhysicsRigidBody_applyTorqueImpulse},
  34. {"asCharacter", lua_PhysicsRigidBody_asCharacter},
  35. {"asGhostObject", lua_PhysicsRigidBody_asGhostObject},
  36. {"asRigidBody", lua_PhysicsRigidBody_asRigidBody},
  37. {"asVehicle", lua_PhysicsRigidBody_asVehicle},
  38. {"asVehicleWheel", lua_PhysicsRigidBody_asVehicleWheel},
  39. {"collidesWith", lua_PhysicsRigidBody_collidesWith},
  40. {"getAngularDamping", lua_PhysicsRigidBody_getAngularDamping},
  41. {"getAngularFactor", lua_PhysicsRigidBody_getAngularFactor},
  42. {"getAngularVelocity", lua_PhysicsRigidBody_getAngularVelocity},
  43. {"getAnisotropicFriction", lua_PhysicsRigidBody_getAnisotropicFriction},
  44. {"getCollisionShape", lua_PhysicsRigidBody_getCollisionShape},
  45. {"getFriction", lua_PhysicsRigidBody_getFriction},
  46. {"getGravity", lua_PhysicsRigidBody_getGravity},
  47. {"getHeight", lua_PhysicsRigidBody_getHeight},
  48. {"getLinearDamping", lua_PhysicsRigidBody_getLinearDamping},
  49. {"getLinearFactor", lua_PhysicsRigidBody_getLinearFactor},
  50. {"getLinearVelocity", lua_PhysicsRigidBody_getLinearVelocity},
  51. {"getMass", lua_PhysicsRigidBody_getMass},
  52. {"getNode", lua_PhysicsRigidBody_getNode},
  53. {"getRestitution", lua_PhysicsRigidBody_getRestitution},
  54. {"getShapeType", lua_PhysicsRigidBody_getShapeType},
  55. {"getType", lua_PhysicsRigidBody_getType},
  56. {"isDynamic", lua_PhysicsRigidBody_isDynamic},
  57. {"isEnabled", lua_PhysicsRigidBody_isEnabled},
  58. {"isKinematic", lua_PhysicsRigidBody_isKinematic},
  59. {"isStatic", lua_PhysicsRigidBody_isStatic},
  60. {"removeCollisionListener", lua_PhysicsRigidBody_removeCollisionListener},
  61. {"setAngularFactor", lua_PhysicsRigidBody_setAngularFactor},
  62. {"setAngularVelocity", lua_PhysicsRigidBody_setAngularVelocity},
  63. {"setAnisotropicFriction", lua_PhysicsRigidBody_setAnisotropicFriction},
  64. {"setDamping", lua_PhysicsRigidBody_setDamping},
  65. {"setEnabled", lua_PhysicsRigidBody_setEnabled},
  66. {"setFriction", lua_PhysicsRigidBody_setFriction},
  67. {"setGravity", lua_PhysicsRigidBody_setGravity},
  68. {"setKinematic", lua_PhysicsRigidBody_setKinematic},
  69. {"setLinearFactor", lua_PhysicsRigidBody_setLinearFactor},
  70. {"setLinearVelocity", lua_PhysicsRigidBody_setLinearVelocity},
  71. {"setRestitution", lua_PhysicsRigidBody_setRestitution},
  72. {NULL, NULL}
  73. };
  74. const luaL_Reg* lua_statics = NULL;
  75. std::vector<std::string> scopePath;
  76. gameplay::ScriptUtil::registerClass("PhysicsRigidBody", lua_members, NULL, NULL, lua_statics, scopePath);
  77. }
  78. static PhysicsRigidBody* getInstance(lua_State* state)
  79. {
  80. void* userdata = luaL_checkudata(state, 1, "PhysicsRigidBody");
  81. luaL_argcheck(state, userdata != NULL, 1, "'PhysicsRigidBody' expected.");
  82. return (PhysicsRigidBody*)((gameplay::ScriptUtil::LuaObject*)userdata)->instance;
  83. }
  84. int lua_PhysicsRigidBody_addCollisionListener(lua_State* state)
  85. {
  86. // Get the number of parameters.
  87. int paramCount = lua_gettop(state);
  88. // Attempt to match the parameters to a valid binding.
  89. switch (paramCount)
  90. {
  91. case 2:
  92. {
  93. do
  94. {
  95. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  96. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  97. {
  98. // Get parameter 1 off the stack.
  99. bool param1Valid;
  100. gameplay::ScriptUtil::LuaArray<PhysicsCollisionObject::CollisionListener> param1 = gameplay::ScriptUtil::getObjectPointer<PhysicsCollisionObject::CollisionListener>(2, "PhysicsCollisionObjectCollisionListener", false, &param1Valid);
  101. if (!param1Valid)
  102. break;
  103. PhysicsRigidBody* instance = getInstance(state);
  104. instance->addCollisionListener(param1);
  105. return 0;
  106. }
  107. } while (0);
  108. do
  109. {
  110. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  111. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  112. {
  113. // Get parameter 1 off the stack.
  114. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  115. PhysicsRigidBody* instance = getInstance(state);
  116. instance->addCollisionListener(param1);
  117. return 0;
  118. }
  119. } while (0);
  120. lua_pushstring(state, "lua_PhysicsRigidBody_addCollisionListener - Failed to match the given parameters to a valid function signature.");
  121. lua_error(state);
  122. break;
  123. }
  124. case 3:
  125. {
  126. do
  127. {
  128. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  129. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
  130. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  131. {
  132. // Get parameter 1 off the stack.
  133. bool param1Valid;
  134. gameplay::ScriptUtil::LuaArray<PhysicsCollisionObject::CollisionListener> param1 = gameplay::ScriptUtil::getObjectPointer<PhysicsCollisionObject::CollisionListener>(2, "PhysicsCollisionObjectCollisionListener", false, &param1Valid);
  135. if (!param1Valid)
  136. break;
  137. // Get parameter 2 off the stack.
  138. bool param2Valid;
  139. gameplay::ScriptUtil::LuaArray<PhysicsCollisionObject> param2 = gameplay::ScriptUtil::getObjectPointer<PhysicsCollisionObject>(3, "PhysicsCollisionObject", false, &param2Valid);
  140. if (!param2Valid)
  141. break;
  142. PhysicsRigidBody* instance = getInstance(state);
  143. instance->addCollisionListener(param1, param2);
  144. return 0;
  145. }
  146. } while (0);
  147. do
  148. {
  149. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  150. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  151. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  152. {
  153. // Get parameter 1 off the stack.
  154. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  155. // Get parameter 2 off the stack.
  156. bool param2Valid;
  157. gameplay::ScriptUtil::LuaArray<PhysicsCollisionObject> param2 = gameplay::ScriptUtil::getObjectPointer<PhysicsCollisionObject>(3, "PhysicsCollisionObject", false, &param2Valid);
  158. if (!param2Valid)
  159. break;
  160. PhysicsRigidBody* instance = getInstance(state);
  161. instance->addCollisionListener(param1, param2);
  162. return 0;
  163. }
  164. } while (0);
  165. lua_pushstring(state, "lua_PhysicsRigidBody_addCollisionListener - Failed to match the given parameters to a valid function signature.");
  166. lua_error(state);
  167. break;
  168. }
  169. default:
  170. {
  171. lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
  172. lua_error(state);
  173. break;
  174. }
  175. }
  176. return 0;
  177. }
  178. int lua_PhysicsRigidBody_applyForce(lua_State* state)
  179. {
  180. // Get the number of parameters.
  181. int paramCount = lua_gettop(state);
  182. // Attempt to match the parameters to a valid binding.
  183. switch (paramCount)
  184. {
  185. case 2:
  186. {
  187. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  188. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  189. {
  190. // Get parameter 1 off the stack.
  191. bool param1Valid;
  192. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param1Valid);
  193. if (!param1Valid)
  194. {
  195. lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector3'.");
  196. lua_error(state);
  197. }
  198. PhysicsRigidBody* instance = getInstance(state);
  199. instance->applyForce(*param1);
  200. return 0;
  201. }
  202. lua_pushstring(state, "lua_PhysicsRigidBody_applyForce - Failed to match the given parameters to a valid function signature.");
  203. lua_error(state);
  204. break;
  205. }
  206. case 3:
  207. {
  208. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  209. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  210. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  211. {
  212. // Get parameter 1 off the stack.
  213. bool param1Valid;
  214. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param1Valid);
  215. if (!param1Valid)
  216. {
  217. lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector3'.");
  218. lua_error(state);
  219. }
  220. // Get parameter 2 off the stack.
  221. bool param2Valid;
  222. gameplay::ScriptUtil::LuaArray<Vector3> param2 = gameplay::ScriptUtil::getObjectPointer<Vector3>(3, "Vector3", false, &param2Valid);
  223. if (!param2Valid)
  224. {
  225. lua_pushstring(state, "Failed to convert parameter 2 to type 'Vector3'.");
  226. lua_error(state);
  227. }
  228. PhysicsRigidBody* instance = getInstance(state);
  229. instance->applyForce(*param1, param2);
  230. return 0;
  231. }
  232. lua_pushstring(state, "lua_PhysicsRigidBody_applyForce - Failed to match the given parameters to a valid function signature.");
  233. lua_error(state);
  234. break;
  235. }
  236. default:
  237. {
  238. lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
  239. lua_error(state);
  240. break;
  241. }
  242. }
  243. return 0;
  244. }
  245. int lua_PhysicsRigidBody_applyImpulse(lua_State* state)
  246. {
  247. // Get the number of parameters.
  248. int paramCount = lua_gettop(state);
  249. // Attempt to match the parameters to a valid binding.
  250. switch (paramCount)
  251. {
  252. case 2:
  253. {
  254. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  255. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  256. {
  257. // Get parameter 1 off the stack.
  258. bool param1Valid;
  259. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param1Valid);
  260. if (!param1Valid)
  261. {
  262. lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector3'.");
  263. lua_error(state);
  264. }
  265. PhysicsRigidBody* instance = getInstance(state);
  266. instance->applyImpulse(*param1);
  267. return 0;
  268. }
  269. lua_pushstring(state, "lua_PhysicsRigidBody_applyImpulse - Failed to match the given parameters to a valid function signature.");
  270. lua_error(state);
  271. break;
  272. }
  273. case 3:
  274. {
  275. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  276. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  277. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  278. {
  279. // Get parameter 1 off the stack.
  280. bool param1Valid;
  281. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param1Valid);
  282. if (!param1Valid)
  283. {
  284. lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector3'.");
  285. lua_error(state);
  286. }
  287. // Get parameter 2 off the stack.
  288. bool param2Valid;
  289. gameplay::ScriptUtil::LuaArray<Vector3> param2 = gameplay::ScriptUtil::getObjectPointer<Vector3>(3, "Vector3", false, &param2Valid);
  290. if (!param2Valid)
  291. {
  292. lua_pushstring(state, "Failed to convert parameter 2 to type 'Vector3'.");
  293. lua_error(state);
  294. }
  295. PhysicsRigidBody* instance = getInstance(state);
  296. instance->applyImpulse(*param1, param2);
  297. return 0;
  298. }
  299. lua_pushstring(state, "lua_PhysicsRigidBody_applyImpulse - Failed to match the given parameters to a valid function signature.");
  300. lua_error(state);
  301. break;
  302. }
  303. default:
  304. {
  305. lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
  306. lua_error(state);
  307. break;
  308. }
  309. }
  310. return 0;
  311. }
  312. int lua_PhysicsRigidBody_applyTorque(lua_State* state)
  313. {
  314. // Get the number of parameters.
  315. int paramCount = lua_gettop(state);
  316. // Attempt to match the parameters to a valid binding.
  317. switch (paramCount)
  318. {
  319. case 2:
  320. {
  321. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  322. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  323. {
  324. // Get parameter 1 off the stack.
  325. bool param1Valid;
  326. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param1Valid);
  327. if (!param1Valid)
  328. {
  329. lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector3'.");
  330. lua_error(state);
  331. }
  332. PhysicsRigidBody* instance = getInstance(state);
  333. instance->applyTorque(*param1);
  334. return 0;
  335. }
  336. lua_pushstring(state, "lua_PhysicsRigidBody_applyTorque - Failed to match the given parameters to a valid function signature.");
  337. lua_error(state);
  338. break;
  339. }
  340. default:
  341. {
  342. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  343. lua_error(state);
  344. break;
  345. }
  346. }
  347. return 0;
  348. }
  349. int lua_PhysicsRigidBody_applyTorqueImpulse(lua_State* state)
  350. {
  351. // Get the number of parameters.
  352. int paramCount = lua_gettop(state);
  353. // Attempt to match the parameters to a valid binding.
  354. switch (paramCount)
  355. {
  356. case 2:
  357. {
  358. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  359. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  360. {
  361. // Get parameter 1 off the stack.
  362. bool param1Valid;
  363. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param1Valid);
  364. if (!param1Valid)
  365. {
  366. lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector3'.");
  367. lua_error(state);
  368. }
  369. PhysicsRigidBody* instance = getInstance(state);
  370. instance->applyTorqueImpulse(*param1);
  371. return 0;
  372. }
  373. lua_pushstring(state, "lua_PhysicsRigidBody_applyTorqueImpulse - Failed to match the given parameters to a valid function signature.");
  374. lua_error(state);
  375. break;
  376. }
  377. default:
  378. {
  379. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  380. lua_error(state);
  381. break;
  382. }
  383. }
  384. return 0;
  385. }
  386. int lua_PhysicsRigidBody_asCharacter(lua_State* state)
  387. {
  388. // Get the number of parameters.
  389. int paramCount = lua_gettop(state);
  390. // Attempt to match the parameters to a valid binding.
  391. switch (paramCount)
  392. {
  393. case 1:
  394. {
  395. if ((lua_type(state, 1) == LUA_TUSERDATA))
  396. {
  397. PhysicsRigidBody* instance = getInstance(state);
  398. void* returnPtr = ((void*)instance->asCharacter());
  399. if (returnPtr)
  400. {
  401. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  402. object->instance = returnPtr;
  403. object->owns = false;
  404. luaL_getmetatable(state, "PhysicsCharacter");
  405. lua_setmetatable(state, -2);
  406. }
  407. else
  408. {
  409. lua_pushnil(state);
  410. }
  411. return 1;
  412. }
  413. lua_pushstring(state, "lua_PhysicsRigidBody_asCharacter - Failed to match the given parameters to a valid function signature.");
  414. lua_error(state);
  415. break;
  416. }
  417. default:
  418. {
  419. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  420. lua_error(state);
  421. break;
  422. }
  423. }
  424. return 0;
  425. }
  426. int lua_PhysicsRigidBody_asGhostObject(lua_State* state)
  427. {
  428. // Get the number of parameters.
  429. int paramCount = lua_gettop(state);
  430. // Attempt to match the parameters to a valid binding.
  431. switch (paramCount)
  432. {
  433. case 1:
  434. {
  435. if ((lua_type(state, 1) == LUA_TUSERDATA))
  436. {
  437. PhysicsRigidBody* instance = getInstance(state);
  438. void* returnPtr = ((void*)instance->asGhostObject());
  439. if (returnPtr)
  440. {
  441. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  442. object->instance = returnPtr;
  443. object->owns = false;
  444. luaL_getmetatable(state, "PhysicsGhostObject");
  445. lua_setmetatable(state, -2);
  446. }
  447. else
  448. {
  449. lua_pushnil(state);
  450. }
  451. return 1;
  452. }
  453. lua_pushstring(state, "lua_PhysicsRigidBody_asGhostObject - Failed to match the given parameters to a valid function signature.");
  454. lua_error(state);
  455. break;
  456. }
  457. default:
  458. {
  459. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  460. lua_error(state);
  461. break;
  462. }
  463. }
  464. return 0;
  465. }
  466. int lua_PhysicsRigidBody_asRigidBody(lua_State* state)
  467. {
  468. // Get the number of parameters.
  469. int paramCount = lua_gettop(state);
  470. // Attempt to match the parameters to a valid binding.
  471. switch (paramCount)
  472. {
  473. case 1:
  474. {
  475. if ((lua_type(state, 1) == LUA_TUSERDATA))
  476. {
  477. PhysicsRigidBody* instance = getInstance(state);
  478. void* returnPtr = ((void*)instance->asRigidBody());
  479. if (returnPtr)
  480. {
  481. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  482. object->instance = returnPtr;
  483. object->owns = false;
  484. luaL_getmetatable(state, "PhysicsRigidBody");
  485. lua_setmetatable(state, -2);
  486. }
  487. else
  488. {
  489. lua_pushnil(state);
  490. }
  491. return 1;
  492. }
  493. lua_pushstring(state, "lua_PhysicsRigidBody_asRigidBody - 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 1).");
  500. lua_error(state);
  501. break;
  502. }
  503. }
  504. return 0;
  505. }
  506. int lua_PhysicsRigidBody_asVehicle(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 1:
  514. {
  515. if ((lua_type(state, 1) == LUA_TUSERDATA))
  516. {
  517. PhysicsRigidBody* instance = getInstance(state);
  518. void* returnPtr = ((void*)instance->asVehicle());
  519. if (returnPtr)
  520. {
  521. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  522. object->instance = returnPtr;
  523. object->owns = false;
  524. luaL_getmetatable(state, "PhysicsVehicle");
  525. lua_setmetatable(state, -2);
  526. }
  527. else
  528. {
  529. lua_pushnil(state);
  530. }
  531. return 1;
  532. }
  533. lua_pushstring(state, "lua_PhysicsRigidBody_asVehicle - Failed to match the given parameters to a valid function signature.");
  534. lua_error(state);
  535. break;
  536. }
  537. default:
  538. {
  539. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  540. lua_error(state);
  541. break;
  542. }
  543. }
  544. return 0;
  545. }
  546. int lua_PhysicsRigidBody_asVehicleWheel(lua_State* state)
  547. {
  548. // Get the number of parameters.
  549. int paramCount = lua_gettop(state);
  550. // Attempt to match the parameters to a valid binding.
  551. switch (paramCount)
  552. {
  553. case 1:
  554. {
  555. if ((lua_type(state, 1) == LUA_TUSERDATA))
  556. {
  557. PhysicsRigidBody* instance = getInstance(state);
  558. void* returnPtr = ((void*)instance->asVehicleWheel());
  559. if (returnPtr)
  560. {
  561. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  562. object->instance = returnPtr;
  563. object->owns = false;
  564. luaL_getmetatable(state, "PhysicsVehicleWheel");
  565. lua_setmetatable(state, -2);
  566. }
  567. else
  568. {
  569. lua_pushnil(state);
  570. }
  571. return 1;
  572. }
  573. lua_pushstring(state, "lua_PhysicsRigidBody_asVehicleWheel - Failed to match the given parameters to a valid function signature.");
  574. lua_error(state);
  575. break;
  576. }
  577. default:
  578. {
  579. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  580. lua_error(state);
  581. break;
  582. }
  583. }
  584. return 0;
  585. }
  586. int lua_PhysicsRigidBody_collidesWith(lua_State* state)
  587. {
  588. // Get the number of parameters.
  589. int paramCount = lua_gettop(state);
  590. // Attempt to match the parameters to a valid binding.
  591. switch (paramCount)
  592. {
  593. case 2:
  594. {
  595. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  596. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  597. {
  598. // Get parameter 1 off the stack.
  599. bool param1Valid;
  600. gameplay::ScriptUtil::LuaArray<PhysicsCollisionObject> param1 = gameplay::ScriptUtil::getObjectPointer<PhysicsCollisionObject>(2, "PhysicsCollisionObject", false, &param1Valid);
  601. if (!param1Valid)
  602. {
  603. lua_pushstring(state, "Failed to convert parameter 1 to type 'PhysicsCollisionObject'.");
  604. lua_error(state);
  605. }
  606. PhysicsRigidBody* instance = getInstance(state);
  607. bool result = instance->collidesWith(param1);
  608. // Push the return value onto the stack.
  609. lua_pushboolean(state, result);
  610. return 1;
  611. }
  612. lua_pushstring(state, "lua_PhysicsRigidBody_collidesWith - Failed to match the given parameters to a valid function signature.");
  613. lua_error(state);
  614. break;
  615. }
  616. default:
  617. {
  618. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  619. lua_error(state);
  620. break;
  621. }
  622. }
  623. return 0;
  624. }
  625. int lua_PhysicsRigidBody_getAngularDamping(lua_State* state)
  626. {
  627. // Get the number of parameters.
  628. int paramCount = lua_gettop(state);
  629. // Attempt to match the parameters to a valid binding.
  630. switch (paramCount)
  631. {
  632. case 1:
  633. {
  634. if ((lua_type(state, 1) == LUA_TUSERDATA))
  635. {
  636. PhysicsRigidBody* instance = getInstance(state);
  637. float result = instance->getAngularDamping();
  638. // Push the return value onto the stack.
  639. lua_pushnumber(state, result);
  640. return 1;
  641. }
  642. lua_pushstring(state, "lua_PhysicsRigidBody_getAngularDamping - Failed to match the given parameters to a valid function signature.");
  643. lua_error(state);
  644. break;
  645. }
  646. default:
  647. {
  648. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  649. lua_error(state);
  650. break;
  651. }
  652. }
  653. return 0;
  654. }
  655. int lua_PhysicsRigidBody_getAngularFactor(lua_State* state)
  656. {
  657. // Get the number of parameters.
  658. int paramCount = lua_gettop(state);
  659. // Attempt to match the parameters to a valid binding.
  660. switch (paramCount)
  661. {
  662. case 1:
  663. {
  664. if ((lua_type(state, 1) == LUA_TUSERDATA))
  665. {
  666. PhysicsRigidBody* instance = getInstance(state);
  667. void* returnPtr = (void*)new Vector3(instance->getAngularFactor());
  668. if (returnPtr)
  669. {
  670. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  671. object->instance = returnPtr;
  672. object->owns = true;
  673. luaL_getmetatable(state, "Vector3");
  674. lua_setmetatable(state, -2);
  675. }
  676. else
  677. {
  678. lua_pushnil(state);
  679. }
  680. return 1;
  681. }
  682. lua_pushstring(state, "lua_PhysicsRigidBody_getAngularFactor - Failed to match the given parameters to a valid function signature.");
  683. lua_error(state);
  684. break;
  685. }
  686. default:
  687. {
  688. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  689. lua_error(state);
  690. break;
  691. }
  692. }
  693. return 0;
  694. }
  695. int lua_PhysicsRigidBody_getAngularVelocity(lua_State* state)
  696. {
  697. // Get the number of parameters.
  698. int paramCount = lua_gettop(state);
  699. // Attempt to match the parameters to a valid binding.
  700. switch (paramCount)
  701. {
  702. case 1:
  703. {
  704. if ((lua_type(state, 1) == LUA_TUSERDATA))
  705. {
  706. PhysicsRigidBody* instance = getInstance(state);
  707. void* returnPtr = (void*)new Vector3(instance->getAngularVelocity());
  708. if (returnPtr)
  709. {
  710. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  711. object->instance = returnPtr;
  712. object->owns = true;
  713. luaL_getmetatable(state, "Vector3");
  714. lua_setmetatable(state, -2);
  715. }
  716. else
  717. {
  718. lua_pushnil(state);
  719. }
  720. return 1;
  721. }
  722. lua_pushstring(state, "lua_PhysicsRigidBody_getAngularVelocity - Failed to match the given parameters to a valid function signature.");
  723. lua_error(state);
  724. break;
  725. }
  726. default:
  727. {
  728. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  729. lua_error(state);
  730. break;
  731. }
  732. }
  733. return 0;
  734. }
  735. int lua_PhysicsRigidBody_getAnisotropicFriction(lua_State* state)
  736. {
  737. // Get the number of parameters.
  738. int paramCount = lua_gettop(state);
  739. // Attempt to match the parameters to a valid binding.
  740. switch (paramCount)
  741. {
  742. case 1:
  743. {
  744. if ((lua_type(state, 1) == LUA_TUSERDATA))
  745. {
  746. PhysicsRigidBody* instance = getInstance(state);
  747. void* returnPtr = (void*)new Vector3(instance->getAnisotropicFriction());
  748. if (returnPtr)
  749. {
  750. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  751. object->instance = returnPtr;
  752. object->owns = true;
  753. luaL_getmetatable(state, "Vector3");
  754. lua_setmetatable(state, -2);
  755. }
  756. else
  757. {
  758. lua_pushnil(state);
  759. }
  760. return 1;
  761. }
  762. lua_pushstring(state, "lua_PhysicsRigidBody_getAnisotropicFriction - Failed to match the given parameters to a valid function signature.");
  763. lua_error(state);
  764. break;
  765. }
  766. default:
  767. {
  768. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  769. lua_error(state);
  770. break;
  771. }
  772. }
  773. return 0;
  774. }
  775. int lua_PhysicsRigidBody_getCollisionShape(lua_State* state)
  776. {
  777. // Get the number of parameters.
  778. int paramCount = lua_gettop(state);
  779. // Attempt to match the parameters to a valid binding.
  780. switch (paramCount)
  781. {
  782. case 1:
  783. {
  784. if ((lua_type(state, 1) == LUA_TUSERDATA))
  785. {
  786. PhysicsRigidBody* instance = getInstance(state);
  787. void* returnPtr = ((void*)instance->getCollisionShape());
  788. if (returnPtr)
  789. {
  790. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  791. object->instance = returnPtr;
  792. object->owns = false;
  793. luaL_getmetatable(state, "PhysicsCollisionShape");
  794. lua_setmetatable(state, -2);
  795. }
  796. else
  797. {
  798. lua_pushnil(state);
  799. }
  800. return 1;
  801. }
  802. lua_pushstring(state, "lua_PhysicsRigidBody_getCollisionShape - Failed to match the given parameters to a valid function signature.");
  803. lua_error(state);
  804. break;
  805. }
  806. default:
  807. {
  808. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  809. lua_error(state);
  810. break;
  811. }
  812. }
  813. return 0;
  814. }
  815. int lua_PhysicsRigidBody_getFriction(lua_State* state)
  816. {
  817. // Get the number of parameters.
  818. int paramCount = lua_gettop(state);
  819. // Attempt to match the parameters to a valid binding.
  820. switch (paramCount)
  821. {
  822. case 1:
  823. {
  824. if ((lua_type(state, 1) == LUA_TUSERDATA))
  825. {
  826. PhysicsRigidBody* instance = getInstance(state);
  827. float result = instance->getFriction();
  828. // Push the return value onto the stack.
  829. lua_pushnumber(state, result);
  830. return 1;
  831. }
  832. lua_pushstring(state, "lua_PhysicsRigidBody_getFriction - Failed to match the given parameters to a valid function signature.");
  833. lua_error(state);
  834. break;
  835. }
  836. default:
  837. {
  838. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  839. lua_error(state);
  840. break;
  841. }
  842. }
  843. return 0;
  844. }
  845. int lua_PhysicsRigidBody_getGravity(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 1:
  853. {
  854. if ((lua_type(state, 1) == LUA_TUSERDATA))
  855. {
  856. PhysicsRigidBody* instance = getInstance(state);
  857. void* returnPtr = (void*)new Vector3(instance->getGravity());
  858. if (returnPtr)
  859. {
  860. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  861. object->instance = returnPtr;
  862. object->owns = true;
  863. luaL_getmetatable(state, "Vector3");
  864. lua_setmetatable(state, -2);
  865. }
  866. else
  867. {
  868. lua_pushnil(state);
  869. }
  870. return 1;
  871. }
  872. lua_pushstring(state, "lua_PhysicsRigidBody_getGravity - Failed to match the given parameters to a valid function signature.");
  873. lua_error(state);
  874. break;
  875. }
  876. default:
  877. {
  878. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  879. lua_error(state);
  880. break;
  881. }
  882. }
  883. return 0;
  884. }
  885. int lua_PhysicsRigidBody_getHeight(lua_State* state)
  886. {
  887. // Get the number of parameters.
  888. int paramCount = lua_gettop(state);
  889. // Attempt to match the parameters to a valid binding.
  890. switch (paramCount)
  891. {
  892. case 3:
  893. {
  894. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  895. lua_type(state, 2) == LUA_TNUMBER &&
  896. lua_type(state, 3) == LUA_TNUMBER)
  897. {
  898. // Get parameter 1 off the stack.
  899. float param1 = (float)luaL_checknumber(state, 2);
  900. // Get parameter 2 off the stack.
  901. float param2 = (float)luaL_checknumber(state, 3);
  902. PhysicsRigidBody* instance = getInstance(state);
  903. float result = instance->getHeight(param1, param2);
  904. // Push the return value onto the stack.
  905. lua_pushnumber(state, result);
  906. return 1;
  907. }
  908. lua_pushstring(state, "lua_PhysicsRigidBody_getHeight - Failed to match the given parameters to a valid function signature.");
  909. lua_error(state);
  910. break;
  911. }
  912. default:
  913. {
  914. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  915. lua_error(state);
  916. break;
  917. }
  918. }
  919. return 0;
  920. }
  921. int lua_PhysicsRigidBody_getLinearDamping(lua_State* state)
  922. {
  923. // Get the number of parameters.
  924. int paramCount = lua_gettop(state);
  925. // Attempt to match the parameters to a valid binding.
  926. switch (paramCount)
  927. {
  928. case 1:
  929. {
  930. if ((lua_type(state, 1) == LUA_TUSERDATA))
  931. {
  932. PhysicsRigidBody* instance = getInstance(state);
  933. float result = instance->getLinearDamping();
  934. // Push the return value onto the stack.
  935. lua_pushnumber(state, result);
  936. return 1;
  937. }
  938. lua_pushstring(state, "lua_PhysicsRigidBody_getLinearDamping - Failed to match the given parameters to a valid function signature.");
  939. lua_error(state);
  940. break;
  941. }
  942. default:
  943. {
  944. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  945. lua_error(state);
  946. break;
  947. }
  948. }
  949. return 0;
  950. }
  951. int lua_PhysicsRigidBody_getLinearFactor(lua_State* state)
  952. {
  953. // Get the number of parameters.
  954. int paramCount = lua_gettop(state);
  955. // Attempt to match the parameters to a valid binding.
  956. switch (paramCount)
  957. {
  958. case 1:
  959. {
  960. if ((lua_type(state, 1) == LUA_TUSERDATA))
  961. {
  962. PhysicsRigidBody* instance = getInstance(state);
  963. void* returnPtr = (void*)new Vector3(instance->getLinearFactor());
  964. if (returnPtr)
  965. {
  966. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  967. object->instance = returnPtr;
  968. object->owns = true;
  969. luaL_getmetatable(state, "Vector3");
  970. lua_setmetatable(state, -2);
  971. }
  972. else
  973. {
  974. lua_pushnil(state);
  975. }
  976. return 1;
  977. }
  978. lua_pushstring(state, "lua_PhysicsRigidBody_getLinearFactor - Failed to match the given parameters to a valid function signature.");
  979. lua_error(state);
  980. break;
  981. }
  982. default:
  983. {
  984. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  985. lua_error(state);
  986. break;
  987. }
  988. }
  989. return 0;
  990. }
  991. int lua_PhysicsRigidBody_getLinearVelocity(lua_State* state)
  992. {
  993. // Get the number of parameters.
  994. int paramCount = lua_gettop(state);
  995. // Attempt to match the parameters to a valid binding.
  996. switch (paramCount)
  997. {
  998. case 1:
  999. {
  1000. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1001. {
  1002. PhysicsRigidBody* instance = getInstance(state);
  1003. void* returnPtr = (void*)new Vector3(instance->getLinearVelocity());
  1004. if (returnPtr)
  1005. {
  1006. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  1007. object->instance = returnPtr;
  1008. object->owns = true;
  1009. luaL_getmetatable(state, "Vector3");
  1010. lua_setmetatable(state, -2);
  1011. }
  1012. else
  1013. {
  1014. lua_pushnil(state);
  1015. }
  1016. return 1;
  1017. }
  1018. lua_pushstring(state, "lua_PhysicsRigidBody_getLinearVelocity - Failed to match the given parameters to a valid function signature.");
  1019. lua_error(state);
  1020. break;
  1021. }
  1022. default:
  1023. {
  1024. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1025. lua_error(state);
  1026. break;
  1027. }
  1028. }
  1029. return 0;
  1030. }
  1031. int lua_PhysicsRigidBody_getMass(lua_State* state)
  1032. {
  1033. // Get the number of parameters.
  1034. int paramCount = lua_gettop(state);
  1035. // Attempt to match the parameters to a valid binding.
  1036. switch (paramCount)
  1037. {
  1038. case 1:
  1039. {
  1040. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1041. {
  1042. PhysicsRigidBody* instance = getInstance(state);
  1043. float result = instance->getMass();
  1044. // Push the return value onto the stack.
  1045. lua_pushnumber(state, result);
  1046. return 1;
  1047. }
  1048. lua_pushstring(state, "lua_PhysicsRigidBody_getMass - Failed to match the given parameters to a valid function signature.");
  1049. lua_error(state);
  1050. break;
  1051. }
  1052. default:
  1053. {
  1054. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1055. lua_error(state);
  1056. break;
  1057. }
  1058. }
  1059. return 0;
  1060. }
  1061. int lua_PhysicsRigidBody_getNode(lua_State* state)
  1062. {
  1063. // Get the number of parameters.
  1064. int paramCount = lua_gettop(state);
  1065. // Attempt to match the parameters to a valid binding.
  1066. switch (paramCount)
  1067. {
  1068. case 1:
  1069. {
  1070. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1071. {
  1072. PhysicsRigidBody* instance = getInstance(state);
  1073. void* returnPtr = ((void*)instance->getNode());
  1074. if (returnPtr)
  1075. {
  1076. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  1077. object->instance = returnPtr;
  1078. object->owns = false;
  1079. luaL_getmetatable(state, "Node");
  1080. lua_setmetatable(state, -2);
  1081. }
  1082. else
  1083. {
  1084. lua_pushnil(state);
  1085. }
  1086. return 1;
  1087. }
  1088. lua_pushstring(state, "lua_PhysicsRigidBody_getNode - Failed to match the given parameters to a valid function signature.");
  1089. lua_error(state);
  1090. break;
  1091. }
  1092. default:
  1093. {
  1094. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1095. lua_error(state);
  1096. break;
  1097. }
  1098. }
  1099. return 0;
  1100. }
  1101. int lua_PhysicsRigidBody_getRestitution(lua_State* state)
  1102. {
  1103. // Get the number of parameters.
  1104. int paramCount = lua_gettop(state);
  1105. // Attempt to match the parameters to a valid binding.
  1106. switch (paramCount)
  1107. {
  1108. case 1:
  1109. {
  1110. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1111. {
  1112. PhysicsRigidBody* instance = getInstance(state);
  1113. float result = instance->getRestitution();
  1114. // Push the return value onto the stack.
  1115. lua_pushnumber(state, result);
  1116. return 1;
  1117. }
  1118. lua_pushstring(state, "lua_PhysicsRigidBody_getRestitution - Failed to match the given parameters to a valid function signature.");
  1119. lua_error(state);
  1120. break;
  1121. }
  1122. default:
  1123. {
  1124. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1125. lua_error(state);
  1126. break;
  1127. }
  1128. }
  1129. return 0;
  1130. }
  1131. int lua_PhysicsRigidBody_getShapeType(lua_State* state)
  1132. {
  1133. // Get the number of parameters.
  1134. int paramCount = lua_gettop(state);
  1135. // Attempt to match the parameters to a valid binding.
  1136. switch (paramCount)
  1137. {
  1138. case 1:
  1139. {
  1140. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1141. {
  1142. PhysicsRigidBody* instance = getInstance(state);
  1143. PhysicsCollisionShape::Type result = instance->getShapeType();
  1144. // Push the return value onto the stack.
  1145. lua_pushnumber(state, (int)result);
  1146. return 1;
  1147. }
  1148. lua_pushstring(state, "lua_PhysicsRigidBody_getShapeType - Failed to match the given parameters to a valid function signature.");
  1149. lua_error(state);
  1150. break;
  1151. }
  1152. default:
  1153. {
  1154. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1155. lua_error(state);
  1156. break;
  1157. }
  1158. }
  1159. return 0;
  1160. }
  1161. int lua_PhysicsRigidBody_getType(lua_State* state)
  1162. {
  1163. // Get the number of parameters.
  1164. int paramCount = lua_gettop(state);
  1165. // Attempt to match the parameters to a valid binding.
  1166. switch (paramCount)
  1167. {
  1168. case 1:
  1169. {
  1170. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1171. {
  1172. PhysicsRigidBody* instance = getInstance(state);
  1173. PhysicsCollisionObject::Type result = instance->getType();
  1174. // Push the return value onto the stack.
  1175. lua_pushnumber(state, (int)result);
  1176. return 1;
  1177. }
  1178. lua_pushstring(state, "lua_PhysicsRigidBody_getType - Failed to match the given parameters to a valid function signature.");
  1179. lua_error(state);
  1180. break;
  1181. }
  1182. default:
  1183. {
  1184. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1185. lua_error(state);
  1186. break;
  1187. }
  1188. }
  1189. return 0;
  1190. }
  1191. int lua_PhysicsRigidBody_isDynamic(lua_State* state)
  1192. {
  1193. // Get the number of parameters.
  1194. int paramCount = lua_gettop(state);
  1195. // Attempt to match the parameters to a valid binding.
  1196. switch (paramCount)
  1197. {
  1198. case 1:
  1199. {
  1200. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1201. {
  1202. PhysicsRigidBody* instance = getInstance(state);
  1203. bool result = instance->isDynamic();
  1204. // Push the return value onto the stack.
  1205. lua_pushboolean(state, result);
  1206. return 1;
  1207. }
  1208. lua_pushstring(state, "lua_PhysicsRigidBody_isDynamic - Failed to match the given parameters to a valid function signature.");
  1209. lua_error(state);
  1210. break;
  1211. }
  1212. default:
  1213. {
  1214. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1215. lua_error(state);
  1216. break;
  1217. }
  1218. }
  1219. return 0;
  1220. }
  1221. int lua_PhysicsRigidBody_isEnabled(lua_State* state)
  1222. {
  1223. // Get the number of parameters.
  1224. int paramCount = lua_gettop(state);
  1225. // Attempt to match the parameters to a valid binding.
  1226. switch (paramCount)
  1227. {
  1228. case 1:
  1229. {
  1230. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1231. {
  1232. PhysicsRigidBody* instance = getInstance(state);
  1233. bool result = instance->isEnabled();
  1234. // Push the return value onto the stack.
  1235. lua_pushboolean(state, result);
  1236. return 1;
  1237. }
  1238. lua_pushstring(state, "lua_PhysicsRigidBody_isEnabled - Failed to match the given parameters to a valid function signature.");
  1239. lua_error(state);
  1240. break;
  1241. }
  1242. default:
  1243. {
  1244. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1245. lua_error(state);
  1246. break;
  1247. }
  1248. }
  1249. return 0;
  1250. }
  1251. int lua_PhysicsRigidBody_isKinematic(lua_State* state)
  1252. {
  1253. // Get the number of parameters.
  1254. int paramCount = lua_gettop(state);
  1255. // Attempt to match the parameters to a valid binding.
  1256. switch (paramCount)
  1257. {
  1258. case 1:
  1259. {
  1260. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1261. {
  1262. PhysicsRigidBody* instance = getInstance(state);
  1263. bool result = instance->isKinematic();
  1264. // Push the return value onto the stack.
  1265. lua_pushboolean(state, result);
  1266. return 1;
  1267. }
  1268. lua_pushstring(state, "lua_PhysicsRigidBody_isKinematic - Failed to match the given parameters to a valid function signature.");
  1269. lua_error(state);
  1270. break;
  1271. }
  1272. default:
  1273. {
  1274. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1275. lua_error(state);
  1276. break;
  1277. }
  1278. }
  1279. return 0;
  1280. }
  1281. int lua_PhysicsRigidBody_isStatic(lua_State* state)
  1282. {
  1283. // Get the number of parameters.
  1284. int paramCount = lua_gettop(state);
  1285. // Attempt to match the parameters to a valid binding.
  1286. switch (paramCount)
  1287. {
  1288. case 1:
  1289. {
  1290. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1291. {
  1292. PhysicsRigidBody* instance = getInstance(state);
  1293. bool result = instance->isStatic();
  1294. // Push the return value onto the stack.
  1295. lua_pushboolean(state, result);
  1296. return 1;
  1297. }
  1298. lua_pushstring(state, "lua_PhysicsRigidBody_isStatic - Failed to match the given parameters to a valid function signature.");
  1299. lua_error(state);
  1300. break;
  1301. }
  1302. default:
  1303. {
  1304. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1305. lua_error(state);
  1306. break;
  1307. }
  1308. }
  1309. return 0;
  1310. }
  1311. int lua_PhysicsRigidBody_removeCollisionListener(lua_State* state)
  1312. {
  1313. // Get the number of parameters.
  1314. int paramCount = lua_gettop(state);
  1315. // Attempt to match the parameters to a valid binding.
  1316. switch (paramCount)
  1317. {
  1318. case 2:
  1319. {
  1320. do
  1321. {
  1322. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1323. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  1324. {
  1325. // Get parameter 1 off the stack.
  1326. bool param1Valid;
  1327. gameplay::ScriptUtil::LuaArray<PhysicsCollisionObject::CollisionListener> param1 = gameplay::ScriptUtil::getObjectPointer<PhysicsCollisionObject::CollisionListener>(2, "PhysicsCollisionObjectCollisionListener", false, &param1Valid);
  1328. if (!param1Valid)
  1329. break;
  1330. PhysicsRigidBody* instance = getInstance(state);
  1331. instance->removeCollisionListener(param1);
  1332. return 0;
  1333. }
  1334. } while (0);
  1335. do
  1336. {
  1337. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1338. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  1339. {
  1340. // Get parameter 1 off the stack.
  1341. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  1342. PhysicsRigidBody* instance = getInstance(state);
  1343. instance->removeCollisionListener(param1);
  1344. return 0;
  1345. }
  1346. } while (0);
  1347. lua_pushstring(state, "lua_PhysicsRigidBody_removeCollisionListener - Failed to match the given parameters to a valid function signature.");
  1348. lua_error(state);
  1349. break;
  1350. }
  1351. case 3:
  1352. {
  1353. do
  1354. {
  1355. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1356. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
  1357. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  1358. {
  1359. // Get parameter 1 off the stack.
  1360. bool param1Valid;
  1361. gameplay::ScriptUtil::LuaArray<PhysicsCollisionObject::CollisionListener> param1 = gameplay::ScriptUtil::getObjectPointer<PhysicsCollisionObject::CollisionListener>(2, "PhysicsCollisionObjectCollisionListener", false, &param1Valid);
  1362. if (!param1Valid)
  1363. break;
  1364. // Get parameter 2 off the stack.
  1365. bool param2Valid;
  1366. gameplay::ScriptUtil::LuaArray<PhysicsCollisionObject> param2 = gameplay::ScriptUtil::getObjectPointer<PhysicsCollisionObject>(3, "PhysicsCollisionObject", false, &param2Valid);
  1367. if (!param2Valid)
  1368. break;
  1369. PhysicsRigidBody* instance = getInstance(state);
  1370. instance->removeCollisionListener(param1, param2);
  1371. return 0;
  1372. }
  1373. } while (0);
  1374. do
  1375. {
  1376. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1377. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  1378. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  1379. {
  1380. // Get parameter 1 off the stack.
  1381. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  1382. // Get parameter 2 off the stack.
  1383. bool param2Valid;
  1384. gameplay::ScriptUtil::LuaArray<PhysicsCollisionObject> param2 = gameplay::ScriptUtil::getObjectPointer<PhysicsCollisionObject>(3, "PhysicsCollisionObject", false, &param2Valid);
  1385. if (!param2Valid)
  1386. break;
  1387. PhysicsRigidBody* instance = getInstance(state);
  1388. instance->removeCollisionListener(param1, param2);
  1389. return 0;
  1390. }
  1391. } while (0);
  1392. lua_pushstring(state, "lua_PhysicsRigidBody_removeCollisionListener - Failed to match the given parameters to a valid function signature.");
  1393. lua_error(state);
  1394. break;
  1395. }
  1396. default:
  1397. {
  1398. lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
  1399. lua_error(state);
  1400. break;
  1401. }
  1402. }
  1403. return 0;
  1404. }
  1405. int lua_PhysicsRigidBody_setAngularFactor(lua_State* state)
  1406. {
  1407. // Get the number of parameters.
  1408. int paramCount = lua_gettop(state);
  1409. // Attempt to match the parameters to a valid binding.
  1410. switch (paramCount)
  1411. {
  1412. case 2:
  1413. {
  1414. do
  1415. {
  1416. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1417. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  1418. {
  1419. // Get parameter 1 off the stack.
  1420. bool param1Valid;
  1421. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param1Valid);
  1422. if (!param1Valid)
  1423. break;
  1424. PhysicsRigidBody* instance = getInstance(state);
  1425. instance->setAngularFactor(*param1);
  1426. return 0;
  1427. }
  1428. } while (0);
  1429. lua_pushstring(state, "lua_PhysicsRigidBody_setAngularFactor - Failed to match the given parameters to a valid function signature.");
  1430. lua_error(state);
  1431. break;
  1432. }
  1433. case 4:
  1434. {
  1435. do
  1436. {
  1437. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1438. lua_type(state, 2) == LUA_TNUMBER &&
  1439. lua_type(state, 3) == LUA_TNUMBER &&
  1440. lua_type(state, 4) == LUA_TNUMBER)
  1441. {
  1442. // Get parameter 1 off the stack.
  1443. float param1 = (float)luaL_checknumber(state, 2);
  1444. // Get parameter 2 off the stack.
  1445. float param2 = (float)luaL_checknumber(state, 3);
  1446. // Get parameter 3 off the stack.
  1447. float param3 = (float)luaL_checknumber(state, 4);
  1448. PhysicsRigidBody* instance = getInstance(state);
  1449. instance->setAngularFactor(param1, param2, param3);
  1450. return 0;
  1451. }
  1452. } while (0);
  1453. lua_pushstring(state, "lua_PhysicsRigidBody_setAngularFactor - Failed to match the given parameters to a valid function signature.");
  1454. lua_error(state);
  1455. break;
  1456. }
  1457. default:
  1458. {
  1459. lua_pushstring(state, "Invalid number of parameters (expected 2 or 4).");
  1460. lua_error(state);
  1461. break;
  1462. }
  1463. }
  1464. return 0;
  1465. }
  1466. int lua_PhysicsRigidBody_setAngularVelocity(lua_State* state)
  1467. {
  1468. // Get the number of parameters.
  1469. int paramCount = lua_gettop(state);
  1470. // Attempt to match the parameters to a valid binding.
  1471. switch (paramCount)
  1472. {
  1473. case 2:
  1474. {
  1475. do
  1476. {
  1477. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1478. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  1479. {
  1480. // Get parameter 1 off the stack.
  1481. bool param1Valid;
  1482. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param1Valid);
  1483. if (!param1Valid)
  1484. break;
  1485. PhysicsRigidBody* instance = getInstance(state);
  1486. instance->setAngularVelocity(*param1);
  1487. return 0;
  1488. }
  1489. } while (0);
  1490. lua_pushstring(state, "lua_PhysicsRigidBody_setAngularVelocity - Failed to match the given parameters to a valid function signature.");
  1491. lua_error(state);
  1492. break;
  1493. }
  1494. case 4:
  1495. {
  1496. do
  1497. {
  1498. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1499. lua_type(state, 2) == LUA_TNUMBER &&
  1500. lua_type(state, 3) == LUA_TNUMBER &&
  1501. lua_type(state, 4) == LUA_TNUMBER)
  1502. {
  1503. // Get parameter 1 off the stack.
  1504. float param1 = (float)luaL_checknumber(state, 2);
  1505. // Get parameter 2 off the stack.
  1506. float param2 = (float)luaL_checknumber(state, 3);
  1507. // Get parameter 3 off the stack.
  1508. float param3 = (float)luaL_checknumber(state, 4);
  1509. PhysicsRigidBody* instance = getInstance(state);
  1510. instance->setAngularVelocity(param1, param2, param3);
  1511. return 0;
  1512. }
  1513. } while (0);
  1514. lua_pushstring(state, "lua_PhysicsRigidBody_setAngularVelocity - Failed to match the given parameters to a valid function signature.");
  1515. lua_error(state);
  1516. break;
  1517. }
  1518. default:
  1519. {
  1520. lua_pushstring(state, "Invalid number of parameters (expected 2 or 4).");
  1521. lua_error(state);
  1522. break;
  1523. }
  1524. }
  1525. return 0;
  1526. }
  1527. int lua_PhysicsRigidBody_setAnisotropicFriction(lua_State* state)
  1528. {
  1529. // Get the number of parameters.
  1530. int paramCount = lua_gettop(state);
  1531. // Attempt to match the parameters to a valid binding.
  1532. switch (paramCount)
  1533. {
  1534. case 2:
  1535. {
  1536. do
  1537. {
  1538. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1539. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  1540. {
  1541. // Get parameter 1 off the stack.
  1542. bool param1Valid;
  1543. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param1Valid);
  1544. if (!param1Valid)
  1545. break;
  1546. PhysicsRigidBody* instance = getInstance(state);
  1547. instance->setAnisotropicFriction(*param1);
  1548. return 0;
  1549. }
  1550. } while (0);
  1551. lua_pushstring(state, "lua_PhysicsRigidBody_setAnisotropicFriction - Failed to match the given parameters to a valid function signature.");
  1552. lua_error(state);
  1553. break;
  1554. }
  1555. case 4:
  1556. {
  1557. do
  1558. {
  1559. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1560. lua_type(state, 2) == LUA_TNUMBER &&
  1561. lua_type(state, 3) == LUA_TNUMBER &&
  1562. lua_type(state, 4) == LUA_TNUMBER)
  1563. {
  1564. // Get parameter 1 off the stack.
  1565. float param1 = (float)luaL_checknumber(state, 2);
  1566. // Get parameter 2 off the stack.
  1567. float param2 = (float)luaL_checknumber(state, 3);
  1568. // Get parameter 3 off the stack.
  1569. float param3 = (float)luaL_checknumber(state, 4);
  1570. PhysicsRigidBody* instance = getInstance(state);
  1571. instance->setAnisotropicFriction(param1, param2, param3);
  1572. return 0;
  1573. }
  1574. } while (0);
  1575. lua_pushstring(state, "lua_PhysicsRigidBody_setAnisotropicFriction - Failed to match the given parameters to a valid function signature.");
  1576. lua_error(state);
  1577. break;
  1578. }
  1579. default:
  1580. {
  1581. lua_pushstring(state, "Invalid number of parameters (expected 2 or 4).");
  1582. lua_error(state);
  1583. break;
  1584. }
  1585. }
  1586. return 0;
  1587. }
  1588. int lua_PhysicsRigidBody_setDamping(lua_State* state)
  1589. {
  1590. // Get the number of parameters.
  1591. int paramCount = lua_gettop(state);
  1592. // Attempt to match the parameters to a valid binding.
  1593. switch (paramCount)
  1594. {
  1595. case 3:
  1596. {
  1597. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1598. lua_type(state, 2) == LUA_TNUMBER &&
  1599. lua_type(state, 3) == LUA_TNUMBER)
  1600. {
  1601. // Get parameter 1 off the stack.
  1602. float param1 = (float)luaL_checknumber(state, 2);
  1603. // Get parameter 2 off the stack.
  1604. float param2 = (float)luaL_checknumber(state, 3);
  1605. PhysicsRigidBody* instance = getInstance(state);
  1606. instance->setDamping(param1, param2);
  1607. return 0;
  1608. }
  1609. lua_pushstring(state, "lua_PhysicsRigidBody_setDamping - Failed to match the given parameters to a valid function signature.");
  1610. lua_error(state);
  1611. break;
  1612. }
  1613. default:
  1614. {
  1615. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  1616. lua_error(state);
  1617. break;
  1618. }
  1619. }
  1620. return 0;
  1621. }
  1622. int lua_PhysicsRigidBody_setEnabled(lua_State* state)
  1623. {
  1624. // Get the number of parameters.
  1625. int paramCount = lua_gettop(state);
  1626. // Attempt to match the parameters to a valid binding.
  1627. switch (paramCount)
  1628. {
  1629. case 2:
  1630. {
  1631. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1632. lua_type(state, 2) == LUA_TBOOLEAN)
  1633. {
  1634. // Get parameter 1 off the stack.
  1635. bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
  1636. PhysicsRigidBody* instance = getInstance(state);
  1637. instance->setEnabled(param1);
  1638. return 0;
  1639. }
  1640. lua_pushstring(state, "lua_PhysicsRigidBody_setEnabled - Failed to match the given parameters to a valid function signature.");
  1641. lua_error(state);
  1642. break;
  1643. }
  1644. default:
  1645. {
  1646. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  1647. lua_error(state);
  1648. break;
  1649. }
  1650. }
  1651. return 0;
  1652. }
  1653. int lua_PhysicsRigidBody_setFriction(lua_State* state)
  1654. {
  1655. // Get the number of parameters.
  1656. int paramCount = lua_gettop(state);
  1657. // Attempt to match the parameters to a valid binding.
  1658. switch (paramCount)
  1659. {
  1660. case 2:
  1661. {
  1662. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1663. lua_type(state, 2) == LUA_TNUMBER)
  1664. {
  1665. // Get parameter 1 off the stack.
  1666. float param1 = (float)luaL_checknumber(state, 2);
  1667. PhysicsRigidBody* instance = getInstance(state);
  1668. instance->setFriction(param1);
  1669. return 0;
  1670. }
  1671. lua_pushstring(state, "lua_PhysicsRigidBody_setFriction - Failed to match the given parameters to a valid function signature.");
  1672. lua_error(state);
  1673. break;
  1674. }
  1675. default:
  1676. {
  1677. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  1678. lua_error(state);
  1679. break;
  1680. }
  1681. }
  1682. return 0;
  1683. }
  1684. int lua_PhysicsRigidBody_setGravity(lua_State* state)
  1685. {
  1686. // Get the number of parameters.
  1687. int paramCount = lua_gettop(state);
  1688. // Attempt to match the parameters to a valid binding.
  1689. switch (paramCount)
  1690. {
  1691. case 2:
  1692. {
  1693. do
  1694. {
  1695. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1696. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  1697. {
  1698. // Get parameter 1 off the stack.
  1699. bool param1Valid;
  1700. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param1Valid);
  1701. if (!param1Valid)
  1702. break;
  1703. PhysicsRigidBody* instance = getInstance(state);
  1704. instance->setGravity(*param1);
  1705. return 0;
  1706. }
  1707. } while (0);
  1708. lua_pushstring(state, "lua_PhysicsRigidBody_setGravity - Failed to match the given parameters to a valid function signature.");
  1709. lua_error(state);
  1710. break;
  1711. }
  1712. case 4:
  1713. {
  1714. do
  1715. {
  1716. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1717. lua_type(state, 2) == LUA_TNUMBER &&
  1718. lua_type(state, 3) == LUA_TNUMBER &&
  1719. lua_type(state, 4) == LUA_TNUMBER)
  1720. {
  1721. // Get parameter 1 off the stack.
  1722. float param1 = (float)luaL_checknumber(state, 2);
  1723. // Get parameter 2 off the stack.
  1724. float param2 = (float)luaL_checknumber(state, 3);
  1725. // Get parameter 3 off the stack.
  1726. float param3 = (float)luaL_checknumber(state, 4);
  1727. PhysicsRigidBody* instance = getInstance(state);
  1728. instance->setGravity(param1, param2, param3);
  1729. return 0;
  1730. }
  1731. } while (0);
  1732. lua_pushstring(state, "lua_PhysicsRigidBody_setGravity - Failed to match the given parameters to a valid function signature.");
  1733. lua_error(state);
  1734. break;
  1735. }
  1736. default:
  1737. {
  1738. lua_pushstring(state, "Invalid number of parameters (expected 2 or 4).");
  1739. lua_error(state);
  1740. break;
  1741. }
  1742. }
  1743. return 0;
  1744. }
  1745. int lua_PhysicsRigidBody_setKinematic(lua_State* state)
  1746. {
  1747. // Get the number of parameters.
  1748. int paramCount = lua_gettop(state);
  1749. // Attempt to match the parameters to a valid binding.
  1750. switch (paramCount)
  1751. {
  1752. case 2:
  1753. {
  1754. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1755. lua_type(state, 2) == LUA_TBOOLEAN)
  1756. {
  1757. // Get parameter 1 off the stack.
  1758. bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
  1759. PhysicsRigidBody* instance = getInstance(state);
  1760. instance->setKinematic(param1);
  1761. return 0;
  1762. }
  1763. lua_pushstring(state, "lua_PhysicsRigidBody_setKinematic - Failed to match the given parameters to a valid function signature.");
  1764. lua_error(state);
  1765. break;
  1766. }
  1767. default:
  1768. {
  1769. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  1770. lua_error(state);
  1771. break;
  1772. }
  1773. }
  1774. return 0;
  1775. }
  1776. int lua_PhysicsRigidBody_setLinearFactor(lua_State* state)
  1777. {
  1778. // Get the number of parameters.
  1779. int paramCount = lua_gettop(state);
  1780. // Attempt to match the parameters to a valid binding.
  1781. switch (paramCount)
  1782. {
  1783. case 2:
  1784. {
  1785. do
  1786. {
  1787. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1788. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  1789. {
  1790. // Get parameter 1 off the stack.
  1791. bool param1Valid;
  1792. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param1Valid);
  1793. if (!param1Valid)
  1794. break;
  1795. PhysicsRigidBody* instance = getInstance(state);
  1796. instance->setLinearFactor(*param1);
  1797. return 0;
  1798. }
  1799. } while (0);
  1800. lua_pushstring(state, "lua_PhysicsRigidBody_setLinearFactor - Failed to match the given parameters to a valid function signature.");
  1801. lua_error(state);
  1802. break;
  1803. }
  1804. case 4:
  1805. {
  1806. do
  1807. {
  1808. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1809. lua_type(state, 2) == LUA_TNUMBER &&
  1810. lua_type(state, 3) == LUA_TNUMBER &&
  1811. lua_type(state, 4) == LUA_TNUMBER)
  1812. {
  1813. // Get parameter 1 off the stack.
  1814. float param1 = (float)luaL_checknumber(state, 2);
  1815. // Get parameter 2 off the stack.
  1816. float param2 = (float)luaL_checknumber(state, 3);
  1817. // Get parameter 3 off the stack.
  1818. float param3 = (float)luaL_checknumber(state, 4);
  1819. PhysicsRigidBody* instance = getInstance(state);
  1820. instance->setLinearFactor(param1, param2, param3);
  1821. return 0;
  1822. }
  1823. } while (0);
  1824. lua_pushstring(state, "lua_PhysicsRigidBody_setLinearFactor - Failed to match the given parameters to a valid function signature.");
  1825. lua_error(state);
  1826. break;
  1827. }
  1828. default:
  1829. {
  1830. lua_pushstring(state, "Invalid number of parameters (expected 2 or 4).");
  1831. lua_error(state);
  1832. break;
  1833. }
  1834. }
  1835. return 0;
  1836. }
  1837. int lua_PhysicsRigidBody_setLinearVelocity(lua_State* state)
  1838. {
  1839. // Get the number of parameters.
  1840. int paramCount = lua_gettop(state);
  1841. // Attempt to match the parameters to a valid binding.
  1842. switch (paramCount)
  1843. {
  1844. case 2:
  1845. {
  1846. do
  1847. {
  1848. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1849. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  1850. {
  1851. // Get parameter 1 off the stack.
  1852. bool param1Valid;
  1853. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param1Valid);
  1854. if (!param1Valid)
  1855. break;
  1856. PhysicsRigidBody* instance = getInstance(state);
  1857. instance->setLinearVelocity(*param1);
  1858. return 0;
  1859. }
  1860. } while (0);
  1861. lua_pushstring(state, "lua_PhysicsRigidBody_setLinearVelocity - Failed to match the given parameters to a valid function signature.");
  1862. lua_error(state);
  1863. break;
  1864. }
  1865. case 4:
  1866. {
  1867. do
  1868. {
  1869. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1870. lua_type(state, 2) == LUA_TNUMBER &&
  1871. lua_type(state, 3) == LUA_TNUMBER &&
  1872. lua_type(state, 4) == LUA_TNUMBER)
  1873. {
  1874. // Get parameter 1 off the stack.
  1875. float param1 = (float)luaL_checknumber(state, 2);
  1876. // Get parameter 2 off the stack.
  1877. float param2 = (float)luaL_checknumber(state, 3);
  1878. // Get parameter 3 off the stack.
  1879. float param3 = (float)luaL_checknumber(state, 4);
  1880. PhysicsRigidBody* instance = getInstance(state);
  1881. instance->setLinearVelocity(param1, param2, param3);
  1882. return 0;
  1883. }
  1884. } while (0);
  1885. lua_pushstring(state, "lua_PhysicsRigidBody_setLinearVelocity - Failed to match the given parameters to a valid function signature.");
  1886. lua_error(state);
  1887. break;
  1888. }
  1889. default:
  1890. {
  1891. lua_pushstring(state, "Invalid number of parameters (expected 2 or 4).");
  1892. lua_error(state);
  1893. break;
  1894. }
  1895. }
  1896. return 0;
  1897. }
  1898. int lua_PhysicsRigidBody_setRestitution(lua_State* state)
  1899. {
  1900. // Get the number of parameters.
  1901. int paramCount = lua_gettop(state);
  1902. // Attempt to match the parameters to a valid binding.
  1903. switch (paramCount)
  1904. {
  1905. case 2:
  1906. {
  1907. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1908. lua_type(state, 2) == LUA_TNUMBER)
  1909. {
  1910. // Get parameter 1 off the stack.
  1911. float param1 = (float)luaL_checknumber(state, 2);
  1912. PhysicsRigidBody* instance = getInstance(state);
  1913. instance->setRestitution(param1);
  1914. return 0;
  1915. }
  1916. lua_pushstring(state, "lua_PhysicsRigidBody_setRestitution - Failed to match the given parameters to a valid function signature.");
  1917. lua_error(state);
  1918. break;
  1919. }
  1920. default:
  1921. {
  1922. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  1923. lua_error(state);
  1924. break;
  1925. }
  1926. }
  1927. return 0;
  1928. }
  1929. }