Add basic lua 5.3 support

This commit is contained in:
Bart van Strien
2015-06-16 10:25:41 +02:00
parent df1bd42dec
commit 3cb777e2b7
39 changed files with 252 additions and 187 deletions
+2 -2
View File
@@ -263,7 +263,7 @@ int Fixture::rayCast(lua_State *L) const
float p2x = Physics::scaleDown((float)luaL_checknumber(L, 3));
float p2y = Physics::scaleDown((float)luaL_checknumber(L, 4));
float maxFraction = (float)luaL_checknumber(L, 5);
int childIndex = (int)luaL_optint(L, 6, 1) - 1; // Convert from 1-based index
int childIndex = (int) luaL_optnumber(L, 6, 1) - 1; // Convert from 1-based index
b2RayCastInput input;
input.p1.Set(p1x, p1y);
input.p2.Set(p2x, p2y);
@@ -279,7 +279,7 @@ int Fixture::rayCast(lua_State *L) const
int Fixture::getBoundingBox(lua_State *L) const
{
int childIndex = (int)luaL_optint(L, 1, 1) - 1; // Convert from 1-based index
int childIndex = (int) luaL_optnumber(L, 1, 1) - 1; // Convert from 1-based index
b2AABB box = fixture->GetAABB(childIndex);
box = Physics::scaleUp(box);
lua_pushnumber(L, box.lowerBound.x);