mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add some missing getter functions to the lua API
ObjectRef: get_properties get_armor_groups get_animation get_attach get_bone_position Players: get_physics_override hud_get_hotbar_itemcount hud_get_hotbar_image hud_get_hotbar_selected_image get_sky get_day_night_ratio get_local_animation get_eye_offset Global: minetest.get_gen_notify minetest.get_noiseparams
This commit is contained in:
parent
990a96578f
commit
c0335f7d13
17 changed files with 665 additions and 8 deletions
|
@ -88,6 +88,24 @@ v2s16 check_v2s16(lua_State *L, int index)
|
|||
return p;
|
||||
}
|
||||
|
||||
void push_v2s16(lua_State *L, v2s16 p)
|
||||
{
|
||||
lua_newtable(L);
|
||||
lua_pushnumber(L, p.X);
|
||||
lua_setfield(L, -2, "x");
|
||||
lua_pushnumber(L, p.Y);
|
||||
lua_setfield(L, -2, "y");
|
||||
}
|
||||
|
||||
void push_v2s32(lua_State *L, v2s32 p)
|
||||
{
|
||||
lua_newtable(L);
|
||||
lua_pushnumber(L, p.X);
|
||||
lua_setfield(L, -2, "x");
|
||||
lua_pushnumber(L, p.Y);
|
||||
lua_setfield(L, -2, "y");
|
||||
}
|
||||
|
||||
v2s32 read_v2s32(lua_State *L, int index)
|
||||
{
|
||||
v2s32 p;
|
||||
|
@ -277,6 +295,23 @@ aabb3f read_aabb3f(lua_State *L, int index, f32 scale)
|
|||
return box;
|
||||
}
|
||||
|
||||
void push_aabb3f(lua_State *L, aabb3f box)
|
||||
{
|
||||
lua_newtable(L);
|
||||
lua_pushnumber(L, box.MinEdge.X);
|
||||
lua_rawseti(L, -2, 1);
|
||||
lua_pushnumber(L, box.MinEdge.Y);
|
||||
lua_rawseti(L, -2, 2);
|
||||
lua_pushnumber(L, box.MinEdge.Z);
|
||||
lua_rawseti(L, -2, 3);
|
||||
lua_pushnumber(L, box.MaxEdge.X);
|
||||
lua_rawseti(L, -2, 4);
|
||||
lua_pushnumber(L, box.MaxEdge.Y);
|
||||
lua_rawseti(L, -2, 5);
|
||||
lua_pushnumber(L, box.MaxEdge.Z);
|
||||
lua_rawseti(L, -2, 6);
|
||||
}
|
||||
|
||||
std::vector<aabb3f> read_aabb3f_vector(lua_State *L, int index, f32 scale)
|
||||
{
|
||||
std::vector<aabb3f> boxes;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue