lua_AnimationClip.cpp 33 KB

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