mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +00:00
add rigidbody.set/is_vdamping
This commit is contained in:
parent
848de01448
commit
9d98c40528
2 changed files with 21 additions and 1 deletions
|
|
@ -56,6 +56,20 @@ static int l_rigidbody_set_gravity_scale(lua::State* L) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int l_rigidbody_is_vdamping(lua::State* L) {
|
||||
if (auto entity = get_entity(L, 1)) {
|
||||
return lua::pushboolean(L, entity->getRigidbody().hitbox.verticalDamping);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int l_rigidbody_set_vdamping(lua::State* L) {
|
||||
if (auto entity = get_entity(L, 1)) {
|
||||
entity->getRigidbody().hitbox.verticalDamping = lua::toboolean(L, 2);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
const luaL_Reg rigidbodylib [] = {
|
||||
{"is_enabled", lua::wrap<l_rigidbody_is_enabled>},
|
||||
{"set_enabled", lua::wrap<l_rigidbody_set_enabled>},
|
||||
|
|
@ -65,5 +79,7 @@ const luaL_Reg rigidbodylib [] = {
|
|||
{"set_size", lua::wrap<l_rigidbody_set_size>},
|
||||
{"get_gravity_scale", lua::wrap<l_rigidbody_get_gravity_scale>},
|
||||
{"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>},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue