mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 20:41:49 +00:00
add rigidbody:is_selectable, :set_selectable
This commit is contained in:
parent
04c367b476
commit
4b4026b028
6 changed files with 26 additions and 2 deletions
|
|
@ -199,6 +199,20 @@ static int l_get_ground_vel(lua::State* L) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int l_is_selectable(lua::State* L) {
|
||||
if (auto entity = get_entity(L, 1)) {
|
||||
return lua::pushboolean(L, entity->getRigidbody().hitbox.selectable);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int l_set_selectable(lua::State* L) {
|
||||
if (auto entity = get_entity(L, 1)) {
|
||||
entity->getRigidbody().selectable = lua::toboolean(L, 2);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
const luaL_Reg rigidbodylib[] = {
|
||||
{"is_enabled", lua::wrap<l_is_enabled>},
|
||||
|
|
@ -226,5 +240,7 @@ const luaL_Reg rigidbodylib[] = {
|
|||
{"get_elasticity", lua::wrap<l_get_elasticity>},
|
||||
{"set_elasticity", lua::wrap<l_set_elasticity>},
|
||||
{"get_ground_vel", lua::wrap<l_get_ground_vel>},
|
||||
{"is_selectable", lua::wrap<l_is_selectable>},
|
||||
{"set_selectable", lua::wrap<l_set_selectable>},
|
||||
{nullptr, nullptr}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue