mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Added many comments, and changed function names for wrapper functions.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user