lua_AnimationClip.cpp 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151
  1. #include "Base.h"
  2. #include "ScriptController.h"
  3. #include "lua_AnimationClip.h"
  4. #include "Animation.h"
  5. #include "AnimationClip.h"
  6. #include "AnimationTarget.h"
  7. #include "Base.h"
  8. #include "Game.h"
  9. #include "Quaternion.h"
  10. #include "Ref.h"
  11. #include "ScriptController.h"
  12. #include "lua_AnimationClipListenerEventType.h"
  13. namespace gameplay
  14. {
  15. void luaRegister_AnimationClip()
  16. {
  17. const luaL_Reg lua_members[] =
  18. {
  19. {"addBeginListener", lua_AnimationClip_addBeginListener},
  20. {"addEndListener", lua_AnimationClip_addEndListener},
  21. {"addListener", lua_AnimationClip_addListener},
  22. {"addRef", lua_AnimationClip_addRef},
  23. {"crossFade", lua_AnimationClip_crossFade},
  24. {"getActiveDuration", lua_AnimationClip_getActiveDuration},
  25. {"getAnimation", lua_AnimationClip_getAnimation},
  26. {"getBlendWeight", lua_AnimationClip_getBlendWeight},
  27. {"getDuration", lua_AnimationClip_getDuration},
  28. {"getElapsedTime", lua_AnimationClip_getElapsedTime},
  29. {"getEndTime", lua_AnimationClip_getEndTime},
  30. {"getId", lua_AnimationClip_getId},
  31. {"getLoopBlendTime", lua_AnimationClip_getLoopBlendTime},
  32. {"getRefCount", lua_AnimationClip_getRefCount},
  33. {"getRepeatCount", lua_AnimationClip_getRepeatCount},
  34. {"getSpeed", lua_AnimationClip_getSpeed},
  35. {"getStartTime", lua_AnimationClip_getStartTime},
  36. {"isPlaying", lua_AnimationClip_isPlaying},
  37. {"pause", lua_AnimationClip_pause},
  38. {"play", lua_AnimationClip_play},
  39. {"release", lua_AnimationClip_release},
  40. {"setActiveDuration", lua_AnimationClip_setActiveDuration},
  41. {"setBlendWeight", lua_AnimationClip_setBlendWeight},
  42. {"setLoopBlendTime", lua_AnimationClip_setLoopBlendTime},
  43. {"setRepeatCount", lua_AnimationClip_setRepeatCount},
  44. {"setSpeed", lua_AnimationClip_setSpeed},
  45. {"stop", lua_AnimationClip_stop},
  46. {NULL, NULL}
  47. };
  48. const luaL_Reg lua_statics[] =
  49. {
  50. {"REPEAT_INDEFINITE", lua_AnimationClip_static_REPEAT_INDEFINITE},
  51. {NULL, NULL}
  52. };
  53. std::vector<std::string> scopePath;
  54. gameplay::ScriptUtil::registerClass("AnimationClip", lua_members, NULL, lua_AnimationClip__gc, lua_statics, scopePath);
  55. }
  56. static AnimationClip* getInstance(lua_State* state)
  57. {
  58. void* userdata = luaL_checkudata(state, 1, "AnimationClip");
  59. luaL_argcheck(state, userdata != NULL, 1, "'AnimationClip' expected.");
  60. return (AnimationClip*)((gameplay::ScriptUtil::LuaObject*)userdata)->instance;
  61. }
  62. int lua_AnimationClip__gc(lua_State* state)
  63. {
  64. // Get the number of parameters.
  65. int paramCount = lua_gettop(state);
  66. // Attempt to match the parameters to a valid binding.
  67. switch (paramCount)
  68. {
  69. case 1:
  70. {
  71. if ((lua_type(state, 1) == LUA_TUSERDATA))
  72. {
  73. void* userdata = luaL_checkudata(state, 1, "AnimationClip");
  74. luaL_argcheck(state, userdata != NULL, 1, "'AnimationClip' expected.");
  75. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)userdata;
  76. if (object->owns)
  77. {
  78. AnimationClip* instance = (AnimationClip*)object->instance;
  79. SAFE_RELEASE(instance);
  80. }
  81. return 0;
  82. }
  83. lua_pushstring(state, "lua_AnimationClip__gc - Failed to match the given parameters to a valid function signature.");
  84. lua_error(state);
  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_AnimationClip_addBeginListener(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 2:
  104. {
  105. do
  106. {
  107. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  108. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  109. {
  110. // Get parameter 1 off the stack.
  111. bool param1Valid;
  112. gameplay::ScriptUtil::LuaArray<AnimationClip::Listener> param1 = gameplay::ScriptUtil::getObjectPointer<AnimationClip::Listener>(2, "AnimationClipListener", false, &param1Valid);
  113. if (!param1Valid)
  114. break;
  115. AnimationClip* instance = getInstance(state);
  116. instance->addBeginListener(param1);
  117. return 0;
  118. }
  119. } while (0);
  120. do
  121. {
  122. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  123. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  124. {
  125. // Get parameter 1 off the stack.
  126. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  127. AnimationClip* instance = getInstance(state);
  128. instance->addBeginListener(param1);
  129. return 0;
  130. }
  131. } while (0);
  132. lua_pushstring(state, "lua_AnimationClip_addBeginListener - Failed to match the given parameters to a valid function signature.");
  133. lua_error(state);
  134. break;
  135. }
  136. default:
  137. {
  138. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  139. lua_error(state);
  140. break;
  141. }
  142. }
  143. return 0;
  144. }
  145. int lua_AnimationClip_addEndListener(lua_State* state)
  146. {
  147. // Get the number of parameters.
  148. int paramCount = lua_gettop(state);
  149. // Attempt to match the parameters to a valid binding.
  150. switch (paramCount)
  151. {
  152. case 2:
  153. {
  154. do
  155. {
  156. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  157. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  158. {
  159. // Get parameter 1 off the stack.
  160. bool param1Valid;
  161. gameplay::ScriptUtil::LuaArray<AnimationClip::Listener> param1 = gameplay::ScriptUtil::getObjectPointer<AnimationClip::Listener>(2, "AnimationClipListener", false, &param1Valid);
  162. if (!param1Valid)
  163. break;
  164. AnimationClip* instance = getInstance(state);
  165. instance->addEndListener(param1);
  166. return 0;
  167. }
  168. } while (0);
  169. do
  170. {
  171. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  172. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  173. {
  174. // Get parameter 1 off the stack.
  175. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  176. AnimationClip* instance = getInstance(state);
  177. instance->addEndListener(param1);
  178. return 0;
  179. }
  180. } while (0);
  181. lua_pushstring(state, "lua_AnimationClip_addEndListener - Failed to match the given parameters to a valid function signature.");
  182. lua_error(state);
  183. break;
  184. }
  185. default:
  186. {
  187. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  188. lua_error(state);
  189. break;
  190. }
  191. }
  192. return 0;
  193. }
  194. int lua_AnimationClip_addListener(lua_State* state)
  195. {
  196. // Get the number of parameters.
  197. int paramCount = lua_gettop(state);
  198. // Attempt to match the parameters to a valid binding.
  199. switch (paramCount)
  200. {
  201. case 3:
  202. {
  203. do
  204. {
  205. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  206. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
  207. lua_type(state, 3) == LUA_TNUMBER)
  208. {
  209. // Get parameter 1 off the stack.
  210. bool param1Valid;
  211. gameplay::ScriptUtil::LuaArray<AnimationClip::Listener> param1 = gameplay::ScriptUtil::getObjectPointer<AnimationClip::Listener>(2, "AnimationClipListener", false, &param1Valid);
  212. if (!param1Valid)
  213. break;
  214. // Get parameter 2 off the stack.
  215. unsigned long param2 = (unsigned long)luaL_checkunsigned(state, 3);
  216. AnimationClip* instance = getInstance(state);
  217. instance->addListener(param1, param2);
  218. return 0;
  219. }
  220. } while (0);
  221. do
  222. {
  223. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  224. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  225. lua_type(state, 3) == LUA_TNUMBER)
  226. {
  227. // Get parameter 1 off the stack.
  228. const char* param1 = gameplay::ScriptUtil::getString(2, false);
  229. // Get parameter 2 off the stack.
  230. unsigned long param2 = (unsigned long)luaL_checkunsigned(state, 3);
  231. AnimationClip* instance = getInstance(state);
  232. instance->addListener(param1, param2);
  233. return 0;
  234. }
  235. } while (0);
  236. lua_pushstring(state, "lua_AnimationClip_addListener - Failed to match the given parameters to a valid function signature.");
  237. lua_error(state);
  238. break;
  239. }
  240. default:
  241. {
  242. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  243. lua_error(state);
  244. break;
  245. }
  246. }
  247. return 0;
  248. }
  249. int lua_AnimationClip_addRef(lua_State* state)
  250. {
  251. // Get the number of parameters.
  252. int paramCount = lua_gettop(state);
  253. // Attempt to match the parameters to a valid binding.
  254. switch (paramCount)
  255. {
  256. case 1:
  257. {
  258. if ((lua_type(state, 1) == LUA_TUSERDATA))
  259. {
  260. AnimationClip* instance = getInstance(state);
  261. instance->addRef();
  262. return 0;
  263. }
  264. lua_pushstring(state, "lua_AnimationClip_addRef - Failed to match the given parameters to a valid function signature.");
  265. lua_error(state);
  266. break;
  267. }
  268. default:
  269. {
  270. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  271. lua_error(state);
  272. break;
  273. }
  274. }
  275. return 0;
  276. }
  277. int lua_AnimationClip_crossFade(lua_State* state)
  278. {
  279. // Get the number of parameters.
  280. int paramCount = lua_gettop(state);
  281. // Attempt to match the parameters to a valid binding.
  282. switch (paramCount)
  283. {
  284. case 3:
  285. {
  286. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  287. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
  288. lua_type(state, 3) == LUA_TNUMBER)
  289. {
  290. // Get parameter 1 off the stack.
  291. bool param1Valid;
  292. gameplay::ScriptUtil::LuaArray<AnimationClip> param1 = gameplay::ScriptUtil::getObjectPointer<AnimationClip>(2, "AnimationClip", false, &param1Valid);
  293. if (!param1Valid)
  294. {
  295. lua_pushstring(state, "Failed to convert parameter 1 to type 'AnimationClip'.");
  296. lua_error(state);
  297. }
  298. // Get parameter 2 off the stack.
  299. unsigned long param2 = (unsigned long)luaL_checkunsigned(state, 3);
  300. AnimationClip* instance = getInstance(state);
  301. instance->crossFade(param1, param2);
  302. return 0;
  303. }
  304. lua_pushstring(state, "lua_AnimationClip_crossFade - Failed to match the given parameters to a valid function signature.");
  305. lua_error(state);
  306. break;
  307. }
  308. default:
  309. {
  310. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  311. lua_error(state);
  312. break;
  313. }
  314. }
  315. return 0;
  316. }
  317. int lua_AnimationClip_getActiveDuration(lua_State* state)
  318. {
  319. // Get the number of parameters.
  320. int paramCount = lua_gettop(state);
  321. // Attempt to match the parameters to a valid binding.
  322. switch (paramCount)
  323. {
  324. case 1:
  325. {
  326. if ((lua_type(state, 1) == LUA_TUSERDATA))
  327. {
  328. AnimationClip* instance = getInstance(state);
  329. unsigned long result = instance->getActiveDuration();
  330. // Push the return value onto the stack.
  331. lua_pushunsigned(state, result);
  332. return 1;
  333. }
  334. lua_pushstring(state, "lua_AnimationClip_getActiveDuration - Failed to match the given parameters to a valid function signature.");
  335. lua_error(state);
  336. break;
  337. }
  338. default:
  339. {
  340. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  341. lua_error(state);
  342. break;
  343. }
  344. }
  345. return 0;
  346. }
  347. int lua_AnimationClip_getAnimation(lua_State* state)
  348. {
  349. // Get the number of parameters.
  350. int paramCount = lua_gettop(state);
  351. // Attempt to match the parameters to a valid binding.
  352. switch (paramCount)
  353. {
  354. case 1:
  355. {
  356. if ((lua_type(state, 1) == LUA_TUSERDATA))
  357. {
  358. AnimationClip* instance = getInstance(state);
  359. void* returnPtr = (void*)instance->getAnimation();
  360. if (returnPtr)
  361. {
  362. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  363. object->instance = returnPtr;
  364. object->owns = false;
  365. luaL_getmetatable(state, "Animation");
  366. lua_setmetatable(state, -2);
  367. }
  368. else
  369. {
  370. lua_pushnil(state);
  371. }
  372. return 1;
  373. }
  374. lua_pushstring(state, "lua_AnimationClip_getAnimation - Failed to match the given parameters to a valid function signature.");
  375. lua_error(state);
  376. break;
  377. }
  378. default:
  379. {
  380. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  381. lua_error(state);
  382. break;
  383. }
  384. }
  385. return 0;
  386. }
  387. int lua_AnimationClip_getBlendWeight(lua_State* state)
  388. {
  389. // Get the number of parameters.
  390. int paramCount = lua_gettop(state);
  391. // Attempt to match the parameters to a valid binding.
  392. switch (paramCount)
  393. {
  394. case 1:
  395. {
  396. if ((lua_type(state, 1) == LUA_TUSERDATA))
  397. {
  398. AnimationClip* instance = getInstance(state);
  399. float result = instance->getBlendWeight();
  400. // Push the return value onto the stack.
  401. lua_pushnumber(state, result);
  402. return 1;
  403. }
  404. lua_pushstring(state, "lua_AnimationClip_getBlendWeight - Failed to match the given parameters to a valid function signature.");
  405. lua_error(state);
  406. break;
  407. }
  408. default:
  409. {
  410. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  411. lua_error(state);
  412. break;
  413. }
  414. }
  415. return 0;
  416. }
  417. int lua_AnimationClip_getDuration(lua_State* state)
  418. {
  419. // Get the number of parameters.
  420. int paramCount = lua_gettop(state);
  421. // Attempt to match the parameters to a valid binding.
  422. switch (paramCount)
  423. {
  424. case 1:
  425. {
  426. if ((lua_type(state, 1) == LUA_TUSERDATA))
  427. {
  428. AnimationClip* instance = getInstance(state);
  429. unsigned long result = instance->getDuration();
  430. // Push the return value onto the stack.
  431. lua_pushunsigned(state, result);
  432. return 1;
  433. }
  434. lua_pushstring(state, "lua_AnimationClip_getDuration - Failed to match the given parameters to a valid function signature.");
  435. lua_error(state);
  436. break;
  437. }
  438. default:
  439. {
  440. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  441. lua_error(state);
  442. break;
  443. }
  444. }
  445. return 0;
  446. }
  447. int lua_AnimationClip_getElapsedTime(lua_State* state)
  448. {
  449. // Get the number of parameters.
  450. int paramCount = lua_gettop(state);
  451. // Attempt to match the parameters to a valid binding.
  452. switch (paramCount)
  453. {
  454. case 1:
  455. {
  456. if ((lua_type(state, 1) == LUA_TUSERDATA))
  457. {
  458. AnimationClip* instance = getInstance(state);
  459. float result = instance->getElapsedTime();
  460. // Push the return value onto the stack.
  461. lua_pushnumber(state, result);
  462. return 1;
  463. }
  464. lua_pushstring(state, "lua_AnimationClip_getElapsedTime - Failed to match the given parameters to a valid function signature.");
  465. lua_error(state);
  466. break;
  467. }
  468. default:
  469. {
  470. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  471. lua_error(state);
  472. break;
  473. }
  474. }
  475. return 0;
  476. }
  477. int lua_AnimationClip_getEndTime(lua_State* state)
  478. {
  479. // Get the number of parameters.
  480. int paramCount = lua_gettop(state);
  481. // Attempt to match the parameters to a valid binding.
  482. switch (paramCount)
  483. {
  484. case 1:
  485. {
  486. if ((lua_type(state, 1) == LUA_TUSERDATA))
  487. {
  488. AnimationClip* instance = getInstance(state);
  489. unsigned long result = instance->getEndTime();
  490. // Push the return value onto the stack.
  491. lua_pushunsigned(state, result);
  492. return 1;
  493. }
  494. lua_pushstring(state, "lua_AnimationClip_getEndTime - Failed to match the given parameters to a valid function signature.");
  495. lua_error(state);
  496. break;
  497. }
  498. default:
  499. {
  500. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  501. lua_error(state);
  502. break;
  503. }
  504. }
  505. return 0;
  506. }
  507. int lua_AnimationClip_getId(lua_State* state)
  508. {
  509. // Get the number of parameters.
  510. int paramCount = lua_gettop(state);
  511. // Attempt to match the parameters to a valid binding.
  512. switch (paramCount)
  513. {
  514. case 1:
  515. {
  516. if ((lua_type(state, 1) == LUA_TUSERDATA))
  517. {
  518. AnimationClip* instance = getInstance(state);
  519. const char* result = instance->getId();
  520. // Push the return value onto the stack.
  521. lua_pushstring(state, result);
  522. return 1;
  523. }
  524. lua_pushstring(state, "lua_AnimationClip_getId - Failed to match the given parameters to a valid function signature.");
  525. lua_error(state);
  526. break;
  527. }
  528. default:
  529. {
  530. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  531. lua_error(state);
  532. break;
  533. }
  534. }
  535. return 0;
  536. }
  537. int lua_AnimationClip_getLoopBlendTime(lua_State* state)
  538. {
  539. // Get the number of parameters.
  540. int paramCount = lua_gettop(state);
  541. // Attempt to match the parameters to a valid binding.
  542. switch (paramCount)
  543. {
  544. case 1:
  545. {
  546. if ((lua_type(state, 1) == LUA_TUSERDATA))
  547. {
  548. AnimationClip* instance = getInstance(state);
  549. float result = instance->getLoopBlendTime();
  550. // Push the return value onto the stack.
  551. lua_pushnumber(state, result);
  552. return 1;
  553. }
  554. lua_pushstring(state, "lua_AnimationClip_getLoopBlendTime - Failed to match the given parameters to a valid function signature.");
  555. lua_error(state);
  556. break;
  557. }
  558. default:
  559. {
  560. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  561. lua_error(state);
  562. break;
  563. }
  564. }
  565. return 0;
  566. }
  567. int lua_AnimationClip_getRefCount(lua_State* state)
  568. {
  569. // Get the number of parameters.
  570. int paramCount = lua_gettop(state);
  571. // Attempt to match the parameters to a valid binding.
  572. switch (paramCount)
  573. {
  574. case 1:
  575. {
  576. if ((lua_type(state, 1) == LUA_TUSERDATA))
  577. {
  578. AnimationClip* instance = getInstance(state);
  579. unsigned int result = instance->getRefCount();
  580. // Push the return value onto the stack.
  581. lua_pushunsigned(state, result);
  582. return 1;
  583. }
  584. lua_pushstring(state, "lua_AnimationClip_getRefCount - Failed to match the given parameters to a valid function signature.");
  585. lua_error(state);
  586. break;
  587. }
  588. default:
  589. {
  590. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  591. lua_error(state);
  592. break;
  593. }
  594. }
  595. return 0;
  596. }
  597. int lua_AnimationClip_getRepeatCount(lua_State* state)
  598. {
  599. // Get the number of parameters.
  600. int paramCount = lua_gettop(state);
  601. // Attempt to match the parameters to a valid binding.
  602. switch (paramCount)
  603. {
  604. case 1:
  605. {
  606. if ((lua_type(state, 1) == LUA_TUSERDATA))
  607. {
  608. AnimationClip* instance = getInstance(state);
  609. float result = instance->getRepeatCount();
  610. // Push the return value onto the stack.
  611. lua_pushnumber(state, result);
  612. return 1;
  613. }
  614. lua_pushstring(state, "lua_AnimationClip_getRepeatCount - Failed to match the given parameters to a valid function signature.");
  615. lua_error(state);
  616. break;
  617. }
  618. default:
  619. {
  620. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  621. lua_error(state);
  622. break;
  623. }
  624. }
  625. return 0;
  626. }
  627. int lua_AnimationClip_getSpeed(lua_State* state)
  628. {
  629. // Get the number of parameters.
  630. int paramCount = lua_gettop(state);
  631. // Attempt to match the parameters to a valid binding.
  632. switch (paramCount)
  633. {
  634. case 1:
  635. {
  636. if ((lua_type(state, 1) == LUA_TUSERDATA))
  637. {
  638. AnimationClip* instance = getInstance(state);
  639. float result = instance->getSpeed();
  640. // Push the return value onto the stack.
  641. lua_pushnumber(state, result);
  642. return 1;
  643. }
  644. lua_pushstring(state, "lua_AnimationClip_getSpeed - Failed to match the given parameters to a valid function signature.");
  645. lua_error(state);
  646. break;
  647. }
  648. default:
  649. {
  650. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  651. lua_error(state);
  652. break;
  653. }
  654. }
  655. return 0;
  656. }
  657. int lua_AnimationClip_getStartTime(lua_State* state)
  658. {
  659. // Get the number of parameters.
  660. int paramCount = lua_gettop(state);
  661. // Attempt to match the parameters to a valid binding.
  662. switch (paramCount)
  663. {
  664. case 1:
  665. {
  666. if ((lua_type(state, 1) == LUA_TUSERDATA))
  667. {
  668. AnimationClip* instance = getInstance(state);
  669. unsigned long result = instance->getStartTime();
  670. // Push the return value onto the stack.
  671. lua_pushunsigned(state, result);
  672. return 1;
  673. }
  674. lua_pushstring(state, "lua_AnimationClip_getStartTime - Failed to match the given parameters to a valid function signature.");
  675. lua_error(state);
  676. break;
  677. }
  678. default:
  679. {
  680. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  681. lua_error(state);
  682. break;
  683. }
  684. }
  685. return 0;
  686. }
  687. int lua_AnimationClip_isPlaying(lua_State* state)
  688. {
  689. // Get the number of parameters.
  690. int paramCount = lua_gettop(state);
  691. // Attempt to match the parameters to a valid binding.
  692. switch (paramCount)
  693. {
  694. case 1:
  695. {
  696. if ((lua_type(state, 1) == LUA_TUSERDATA))
  697. {
  698. AnimationClip* instance = getInstance(state);
  699. bool result = instance->isPlaying();
  700. // Push the return value onto the stack.
  701. lua_pushboolean(state, result);
  702. return 1;
  703. }
  704. lua_pushstring(state, "lua_AnimationClip_isPlaying - Failed to match the given parameters to a valid function signature.");
  705. lua_error(state);
  706. break;
  707. }
  708. default:
  709. {
  710. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  711. lua_error(state);
  712. break;
  713. }
  714. }
  715. return 0;
  716. }
  717. int lua_AnimationClip_pause(lua_State* state)
  718. {
  719. // Get the number of parameters.
  720. int paramCount = lua_gettop(state);
  721. // Attempt to match the parameters to a valid binding.
  722. switch (paramCount)
  723. {
  724. case 1:
  725. {
  726. if ((lua_type(state, 1) == LUA_TUSERDATA))
  727. {
  728. AnimationClip* instance = getInstance(state);
  729. instance->pause();
  730. return 0;
  731. }
  732. lua_pushstring(state, "lua_AnimationClip_pause - Failed to match the given parameters to a valid function signature.");
  733. lua_error(state);
  734. break;
  735. }
  736. default:
  737. {
  738. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  739. lua_error(state);
  740. break;
  741. }
  742. }
  743. return 0;
  744. }
  745. int lua_AnimationClip_play(lua_State* state)
  746. {
  747. // Get the number of parameters.
  748. int paramCount = lua_gettop(state);
  749. // Attempt to match the parameters to a valid binding.
  750. switch (paramCount)
  751. {
  752. case 1:
  753. {
  754. if ((lua_type(state, 1) == LUA_TUSERDATA))
  755. {
  756. AnimationClip* instance = getInstance(state);
  757. instance->play();
  758. return 0;
  759. }
  760. lua_pushstring(state, "lua_AnimationClip_play - Failed to match the given parameters to a valid function signature.");
  761. lua_error(state);
  762. break;
  763. }
  764. default:
  765. {
  766. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  767. lua_error(state);
  768. break;
  769. }
  770. }
  771. return 0;
  772. }
  773. int lua_AnimationClip_release(lua_State* state)
  774. {
  775. // Get the number of parameters.
  776. int paramCount = lua_gettop(state);
  777. // Attempt to match the parameters to a valid binding.
  778. switch (paramCount)
  779. {
  780. case 1:
  781. {
  782. if ((lua_type(state, 1) == LUA_TUSERDATA))
  783. {
  784. AnimationClip* instance = getInstance(state);
  785. instance->release();
  786. return 0;
  787. }
  788. lua_pushstring(state, "lua_AnimationClip_release - Failed to match the given parameters to a valid function signature.");
  789. lua_error(state);
  790. break;
  791. }
  792. default:
  793. {
  794. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  795. lua_error(state);
  796. break;
  797. }
  798. }
  799. return 0;
  800. }
  801. int lua_AnimationClip_setActiveDuration(lua_State* state)
  802. {
  803. // Get the number of parameters.
  804. int paramCount = lua_gettop(state);
  805. // Attempt to match the parameters to a valid binding.
  806. switch (paramCount)
  807. {
  808. case 2:
  809. {
  810. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  811. lua_type(state, 2) == LUA_TNUMBER)
  812. {
  813. // Get parameter 1 off the stack.
  814. unsigned long param1 = (unsigned long)luaL_checkunsigned(state, 2);
  815. AnimationClip* instance = getInstance(state);
  816. instance->setActiveDuration(param1);
  817. return 0;
  818. }
  819. lua_pushstring(state, "lua_AnimationClip_setActiveDuration - Failed to match the given parameters to a valid function signature.");
  820. lua_error(state);
  821. break;
  822. }
  823. default:
  824. {
  825. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  826. lua_error(state);
  827. break;
  828. }
  829. }
  830. return 0;
  831. }
  832. int lua_AnimationClip_setBlendWeight(lua_State* state)
  833. {
  834. // Get the number of parameters.
  835. int paramCount = lua_gettop(state);
  836. // Attempt to match the parameters to a valid binding.
  837. switch (paramCount)
  838. {
  839. case 2:
  840. {
  841. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  842. lua_type(state, 2) == LUA_TNUMBER)
  843. {
  844. // Get parameter 1 off the stack.
  845. float param1 = (float)luaL_checknumber(state, 2);
  846. AnimationClip* instance = getInstance(state);
  847. instance->setBlendWeight(param1);
  848. return 0;
  849. }
  850. lua_pushstring(state, "lua_AnimationClip_setBlendWeight - Failed to match the given parameters to a valid function signature.");
  851. lua_error(state);
  852. break;
  853. }
  854. default:
  855. {
  856. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  857. lua_error(state);
  858. break;
  859. }
  860. }
  861. return 0;
  862. }
  863. int lua_AnimationClip_setLoopBlendTime(lua_State* state)
  864. {
  865. // Get the number of parameters.
  866. int paramCount = lua_gettop(state);
  867. // Attempt to match the parameters to a valid binding.
  868. switch (paramCount)
  869. {
  870. case 2:
  871. {
  872. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  873. lua_type(state, 2) == LUA_TNUMBER)
  874. {
  875. // Get parameter 1 off the stack.
  876. float param1 = (float)luaL_checknumber(state, 2);
  877. AnimationClip* instance = getInstance(state);
  878. instance->setLoopBlendTime(param1);
  879. return 0;
  880. }
  881. lua_pushstring(state, "lua_AnimationClip_setLoopBlendTime - Failed to match the given parameters to a valid function signature.");
  882. lua_error(state);
  883. break;
  884. }
  885. default:
  886. {
  887. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  888. lua_error(state);
  889. break;
  890. }
  891. }
  892. return 0;
  893. }
  894. int lua_AnimationClip_setRepeatCount(lua_State* state)
  895. {
  896. // Get the number of parameters.
  897. int paramCount = lua_gettop(state);
  898. // Attempt to match the parameters to a valid binding.
  899. switch (paramCount)
  900. {
  901. case 2:
  902. {
  903. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  904. lua_type(state, 2) == LUA_TNUMBER)
  905. {
  906. // Get parameter 1 off the stack.
  907. float param1 = (float)luaL_checknumber(state, 2);
  908. AnimationClip* instance = getInstance(state);
  909. instance->setRepeatCount(param1);
  910. return 0;
  911. }
  912. lua_pushstring(state, "lua_AnimationClip_setRepeatCount - Failed to match the given parameters to a valid function signature.");
  913. lua_error(state);
  914. break;
  915. }
  916. default:
  917. {
  918. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  919. lua_error(state);
  920. break;
  921. }
  922. }
  923. return 0;
  924. }
  925. int lua_AnimationClip_setSpeed(lua_State* state)
  926. {
  927. // Get the number of parameters.
  928. int paramCount = lua_gettop(state);
  929. // Attempt to match the parameters to a valid binding.
  930. switch (paramCount)
  931. {
  932. case 2:
  933. {
  934. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  935. lua_type(state, 2) == LUA_TNUMBER)
  936. {
  937. // Get parameter 1 off the stack.
  938. float param1 = (float)luaL_checknumber(state, 2);
  939. AnimationClip* instance = getInstance(state);
  940. instance->setSpeed(param1);
  941. return 0;
  942. }
  943. lua_pushstring(state, "lua_AnimationClip_setSpeed - Failed to match the given parameters to a valid function signature.");
  944. lua_error(state);
  945. break;
  946. }
  947. default:
  948. {
  949. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  950. lua_error(state);
  951. break;
  952. }
  953. }
  954. return 0;
  955. }
  956. int lua_AnimationClip_static_REPEAT_INDEFINITE(lua_State* state)
  957. {
  958. // Validate the number of parameters.
  959. if (lua_gettop(state) > 0)
  960. {
  961. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  962. lua_error(state);
  963. }
  964. unsigned int result = AnimationClip::REPEAT_INDEFINITE;
  965. // Push the return value onto the stack.
  966. lua_pushunsigned(state, result);
  967. return 1;
  968. }
  969. int lua_AnimationClip_stop(lua_State* state)
  970. {
  971. // Get the number of parameters.
  972. int paramCount = lua_gettop(state);
  973. // Attempt to match the parameters to a valid binding.
  974. switch (paramCount)
  975. {
  976. case 1:
  977. {
  978. if ((lua_type(state, 1) == LUA_TUSERDATA))
  979. {
  980. AnimationClip* instance = getInstance(state);
  981. instance->stop();
  982. return 0;
  983. }
  984. lua_pushstring(state, "lua_AnimationClip_stop - Failed to match the given parameters to a valid function signature.");
  985. lua_error(state);
  986. break;
  987. }
  988. default:
  989. {
  990. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  991. lua_error(state);
  992. break;
  993. }
  994. }
  995. return 0;
  996. }
  997. }