LPCGame
A Simple 2d Game Engine
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
luacmath.h
1 #ifndef LUACMATH_H
2 #define LUACMATH_H
3 
4 #include <string>
5 #include <lua.hpp>
6 
8 
12 namespace LuaC {
14  const std::string mathClass = "Math";
18  class MathLib {
19  public:
21  static int luaopen_math(lua_State *l);
22 
23  private:
25  static void openDirEnum(lua_State *l);
27  static const struct luaL_reg luaMathLib[];
28  //The various library functions
29  static int distance(lua_State *l);
30  static int clamp(lua_State *l);
31  static int magnitude(lua_State *l);
32  static int normalize(lua_State *l);
33  static int lerp(lua_State *l);
34  static int forwardVector(lua_State *l);
35  static int rectNearRect(lua_State *l);
36  static int checkCollision(lua_State *l);
37  static int toSceneSpace(lua_State *l);
38  static int fromSceneSpace(lua_State *l);
39  };
40 }
41 
42 #endif