Added many comments, and changed function names for wrapper functions.

This commit is contained in:
rude
2009-08-09 21:08:55 +02:00
parent f2adfd53f2
commit ba1a75e547
103 changed files with 2608 additions and 2391 deletions
+19 -20
View File
@@ -29,62 +29,61 @@ namespace box2d
Contact * luax_checkcontact(lua_State * L, int idx)
{
return luax_checktype<Contact>(L, idx, "Contact", LOVE_PHYSICS_CONTACT_BITS);
return luax_checktype<Contact>(L, idx, "Contact", PHYSICS_CONTACT_T);
}
int _wrap_Contact_getPosition(lua_State * L)
int w_Contact_getPosition(lua_State * L)
{
Contact * t = luax_checkcontact(L, 1);
return t->getPosition(L);
}
int _wrap_Contact_getVelocity(lua_State * L)
int w_Contact_getVelocity(lua_State * L)
{
Contact * t = luax_checkcontact(L, 1);
return t->getVelocity(L);
}
int _wrap_Contact_getNormal(lua_State * L)
int w_Contact_getNormal(lua_State * L)
{
Contact * t = luax_checkcontact(L, 1);
return t->getNormal(L);
}
int _wrap_Contact_getSeparation(lua_State * L)
int w_Contact_getSeparation(lua_State * L)
{
Contact * t = luax_checkcontact(L, 1);
lua_pushnumber(L, t->getSeparation());
return 1;
}
int _wrap_Contact_getFriction(lua_State * L)
int w_Contact_getFriction(lua_State * L)
{
Contact * t = luax_checkcontact(L, 1);
lua_pushnumber(L, t->getFriction());
return 1;
}
int _wrap_Contact_getRestitution(lua_State * L)
int w_Contact_getRestitution(lua_State * L)
{
Contact * t = luax_checkcontact(L, 1);
lua_pushnumber(L, t->getRestitution());
return 1;
}
static const luaL_Reg wrap_Contact_functions[] = {
{ "getPosition", _wrap_Contact_getPosition },
{ "getVelocity", _wrap_Contact_getVelocity },
{ "getNormal", _wrap_Contact_getNormal },
{ "getSeparation", _wrap_Contact_getSeparation },
{ "getFriction", _wrap_Contact_getFriction },
{ "getRestitution", _wrap_Contact_getRestitution },
{ 0, 0 }
};
int wrap_Contact_open(lua_State * L)
int luaopen_contact(lua_State * L)
{
luax_register_type(L, "Contact", wrap_Contact_functions);
return 0;
static const luaL_Reg functions[] = {
{ "getPosition", w_Contact_getPosition },
{ "getVelocity", w_Contact_getVelocity },
{ "getNormal", w_Contact_getNormal },
{ "getSeparation", w_Contact_getSeparation },
{ "getFriction", w_Contact_getFriction },
{ "getRestitution", w_Contact_getRestitution },
{ 0, 0 }
};
return luax_register_type(L, "Contact", functions);
}
} // box2d