add rigidbody.is_grounded
This commit is contained in:
@@ -70,6 +70,13 @@ static int l_rigidbody_set_vdamping(lua::State* L) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int l_rigidbody_is_grounded(lua::State* L) {
|
||||
if (auto entity = get_entity(L, 1)) {
|
||||
return lua::pushboolean(L, entity->getRigidbody().hitbox.grounded);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
const luaL_Reg rigidbodylib [] = {
|
||||
{"is_enabled", lua::wrap<l_rigidbody_is_enabled>},
|
||||
{"set_enabled", lua::wrap<l_rigidbody_set_enabled>},
|
||||
@@ -81,5 +88,6 @@ const luaL_Reg rigidbodylib [] = {
|
||||
{"set_gravity_scale", lua::wrap<l_rigidbody_set_gravity_scale>},
|
||||
{"is_vdamping", lua::wrap<l_rigidbody_is_vdamping>},
|
||||
{"set_vdamping", lua::wrap<l_rigidbody_set_vdamping>},
|
||||
{"is_grounded", lua::wrap<l_rigidbody_is_grounded>},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user