Physics2DLUA.cpp 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #include "Physics2DLUA.h"
  2. #include "Physics2DLUAWrappers.h"
  3. int luaopen_Physics2D(lua_State *L) {
  4. CoreServices *inst = (CoreServices*)lua_topointer(L, 1);
  5. CoreServices::setInstance(inst);
  6. static const struct luaL_reg physics2dLib [] = { {"PhysicsScreen", Physics2D_PhysicsScreen},
  7. {"PhysicsScreen_Update", Physics2D_PhysicsScreen_Update},
  8. {"PhysicsScreen_addPhysicsChild", Physics2D_PhysicsScreen_addPhysicsChild},
  9. {"PhysicsScreen_removePhysicsChild", Physics2D_PhysicsScreen_removePhysicsChild},
  10. {"PhysicsScreen_addCollisionChild", Physics2D_PhysicsScreen_addCollisionChild},
  11. {"PhysicsScreen_destroyJoint", Physics2D_PhysicsScreen_destroyJoint},
  12. {"PhysicsScreen_createDistanceJoint", Physics2D_PhysicsScreen_createDistanceJoint},
  13. {"PhysicsScreen_createPrismaticJoint", Physics2D_PhysicsScreen_createPrismaticJoint},
  14. {"PhysicsScreen_createRevoluteJoint", Physics2D_PhysicsScreen_createRevoluteJoint},
  15. {"PhysicsScreen_applyForce", Physics2D_PhysicsScreen_applyForce},
  16. {"PhysicsScreen_applyImpulse", Physics2D_PhysicsScreen_applyImpulse},
  17. {"PhysicsScreen_setGravity", Physics2D_PhysicsScreen_setGravity},
  18. {"PhysicsScreen_setTransform", Physics2D_PhysicsScreen_setTransform},
  19. {"PhysicsScreen_getPhysicsEntityByShape", Physics2D_PhysicsScreen_getPhysicsEntityByShape},
  20. {"PhysicsScreen_getPhysicsEntityByFixture", Physics2D_PhysicsScreen_getPhysicsEntityByFixture},
  21. {"PhysicsScreen_setVelocity", Physics2D_PhysicsScreen_setVelocity},
  22. {"PhysicsScreen_setVelocityX", Physics2D_PhysicsScreen_setVelocityX},
  23. {"PhysicsScreen_setVelocityY", Physics2D_PhysicsScreen_setVelocityY},
  24. {"PhysicsScreen_setSpin", Physics2D_PhysicsScreen_setSpin},
  25. {"PhysicsScreen_getVelocity", Physics2D_PhysicsScreen_getVelocity},
  26. {"PhysicsScreen_BeginContact", Physics2D_PhysicsScreen_BeginContact},
  27. {"PhysicsScreen_EndContact", Physics2D_PhysicsScreen_EndContact},
  28. {"PhysicsScreen_PostSolve", Physics2D_PhysicsScreen_PostSolve},
  29. {"PhysicsScreen_wakeUp", Physics2D_PhysicsScreen_wakeUp},
  30. {"PhysicsScreen_getEntityAtPosition", Physics2D_PhysicsScreen_getEntityAtPosition},
  31. {"PhysicsScreen_testEntityAtPosition", Physics2D_PhysicsScreen_testEntityAtPosition},
  32. {"PhysicsScreen_Shutdown", Physics2D_PhysicsScreen_Shutdown},
  33. {"PhysicsScreen_getPhysicsByScreenEntity", Physics2D_PhysicsScreen_getPhysicsByScreenEntity},
  34. {"PhysicsScreen_destroyMouseJoint", Physics2D_PhysicsScreen_destroyMouseJoint},
  35. {"delete_PhysicsScreen", Physics2D_delete_PhysicsScreen},
  36. {"PhysicsJoint", Physics2D_PhysicsJoint},
  37. {"delete_PhysicsJoint", Physics2D_delete_PhysicsJoint},
  38. {"PhysicsScreenEvent_get_localCollisionNormal", Physics2D_PhysicsScreenEvent_get_localCollisionNormal},
  39. {"PhysicsScreenEvent_get_worldCollisionNormal", Physics2D_PhysicsScreenEvent_get_worldCollisionNormal},
  40. {"PhysicsScreenEvent_get_localCollisionPoint", Physics2D_PhysicsScreenEvent_get_localCollisionPoint},
  41. {"PhysicsScreenEvent_get_impactStrength", Physics2D_PhysicsScreenEvent_get_impactStrength},
  42. {"PhysicsScreenEvent_get_frictionStrength", Physics2D_PhysicsScreenEvent_get_frictionStrength},
  43. {"PhysicsScreenEvent_set_impactStrength", Physics2D_PhysicsScreenEvent_set_impactStrength},
  44. {"PhysicsScreenEvent_set_frictionStrength", Physics2D_PhysicsScreenEvent_set_frictionStrength},
  45. {"PhysicsScreenEvent", Physics2D_PhysicsScreenEvent},
  46. {"PhysicsScreenEvent_getFirstEntity", Physics2D_PhysicsScreenEvent_getFirstEntity},
  47. {"PhysicsScreenEvent_getSecondEntity", Physics2D_PhysicsScreenEvent_getSecondEntity},
  48. {"delete_PhysicsScreenEvent", Physics2D_delete_PhysicsScreenEvent},
  49. {"PhysicsScreenEntity_get_collisionOnly", Physics2D_PhysicsScreenEntity_get_collisionOnly},
  50. {"PhysicsScreenEntity_set_collisionOnly", Physics2D_PhysicsScreenEntity_set_collisionOnly},
  51. {"PhysicsScreenEntity", Physics2D_PhysicsScreenEntity},
  52. {"PhysicsScreenEntity_getScreenEntity", Physics2D_PhysicsScreenEntity_getScreenEntity},
  53. {"PhysicsScreenEntity_applyTorque", Physics2D_PhysicsScreenEntity_applyTorque},
  54. {"PhysicsScreenEntity_applyForce", Physics2D_PhysicsScreenEntity_applyForce},
  55. {"PhysicsScreenEntity_setTransform", Physics2D_PhysicsScreenEntity_setTransform},
  56. {"PhysicsScreenEntity_Update", Physics2D_PhysicsScreenEntity_Update},
  57. {"delete_PhysicsScreenEntity", Physics2D_delete_PhysicsScreenEntity},
  58. {NULL, NULL}
  59. };
  60. luaL_openlib(L, "Physics2D", physics2dLib, 0);
  61. return 1;
  62. }