update drop-item model

This commit is contained in:
MihailRis
2024-07-03 17:46:03 +03:00
parent 48b5be6bc9
commit 7c5f8107de
4 changed files with 98 additions and 33 deletions
+9 -1
View File
@@ -119,7 +119,14 @@ static int l_set_enabled(lua::State* L) {
static int l_get_size(lua::State* L) {
if (auto entity = get_entity(L, 1)) {
return lua::pushvec3(L, entity->getRigidbody().hitbox.halfsize * 2.0f);
return lua::pushvec3_arr(L, entity->getRigidbody().hitbox.halfsize * 2.0f);
}
return 0;
}
static int l_set_size(lua::State* L) {
if (auto entity = get_entity(L, 1)) {
entity->getRigidbody().hitbox.halfsize = lua::tovec3(L, 2) * 0.5f;
}
return 0;
}
@@ -199,5 +206,6 @@ const luaL_Reg rigidbodylib [] = {
{"get_vel", lua::wrap<l_get_vel>},
{"set_vel", lua::wrap<l_set_vel>},
{"get_size", lua::wrap<l_get_size>},
{"set_size", lua::wrap<l_set_size>},
{NULL, NULL}
};