Physics2DLUA.cpp 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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_wakeUp", Physics2D_PhysicsScreen_wakeUp},
  29. {"PhysicsScreen_getEntityCollisionNormal", Physics2D_PhysicsScreen_getEntityCollisionNormal},
  30. {"PhysicsScreen_areEntitiesColliding", Physics2D_PhysicsScreen_areEntitiesColliding},
  31. {"PhysicsScreen_getEntityAtPosition", Physics2D_PhysicsScreen_getEntityAtPosition},
  32. {"PhysicsScreen_testEntityAtPosition", Physics2D_PhysicsScreen_testEntityAtPosition},
  33. {"PhysicsScreen_Shutdown", Physics2D_PhysicsScreen_Shutdown},
  34. {"PhysicsScreen_getPhysicsByScreenEntity", Physics2D_PhysicsScreen_getPhysicsByScreenEntity},
  35. {"PhysicsScreen_destroyMouseJoint", Physics2D_PhysicsScreen_destroyMouseJoint},
  36. {"delete_PhysicsScreen", Physics2D_delete_PhysicsScreen},
  37. {"PhysicsJoint", Physics2D_PhysicsJoint},
  38. {"delete_PhysicsJoint", Physics2D_delete_PhysicsJoint},
  39. {"PhysicsScreenEntity_get_collisionOnly", Physics2D_PhysicsScreenEntity_get_collisionOnly},
  40. {"PhysicsScreenEntity_set_collisionOnly", Physics2D_PhysicsScreenEntity_set_collisionOnly},
  41. {"PhysicsScreenEntity", Physics2D_PhysicsScreenEntity},
  42. {"PhysicsScreenEntity_getScreenEntity", Physics2D_PhysicsScreenEntity_getScreenEntity},
  43. {"PhysicsScreenEntity_applyTorque", Physics2D_PhysicsScreenEntity_applyTorque},
  44. {"PhysicsScreenEntity_applyForce", Physics2D_PhysicsScreenEntity_applyForce},
  45. {"PhysicsScreenEntity_setTransform", Physics2D_PhysicsScreenEntity_setTransform},
  46. {"PhysicsScreenEntity_Update", Physics2D_PhysicsScreenEntity_Update},
  47. {"delete_PhysicsScreenEntity", Physics2D_delete_PhysicsScreenEntity},
  48. {NULL, NULL}
  49. };
  50. luaL_openlib(L, "Physics2D", physics2dLib, 0);
  51. return 1;
  52. }