From faa358e797128ab07bb5644ce305a832d59e5596 Mon Sep 17 00:00:00 2001 From: CoderForTheBetter Date: Wed, 28 Nov 2018 03:38:50 -0500 Subject: Add Lua methods 'set_rotation()' and 'get_rotation()' (#7395) * Adds Lua methods 'set_rotation()' and 'get_rotation'. Also changed some method names to be more clear. Instead of an f32 being sent over network for yaw, now a v3f is sent for rotation on xyz axes. Perserved Lua method set_yaw/setyaw so that old mods still work, other wise to set yaw they would need to switch to set_rotation(0, yaw, 0). --- src/script/lua_api/l_object.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/script/lua_api/l_object.h') diff --git a/src/script/lua_api/l_object.h b/src/script/lua_api/l_object.h index 6876ea512..c7d963d87 100644 --- a/src/script/lua_api/l_object.h +++ b/src/script/lua_api/l_object.h @@ -172,6 +172,12 @@ private: // get_acceleration(self) static int l_get_acceleration(lua_State *L); + // set_rotation(self, {x=num, y=num, z=num}) + static int l_set_rotation(lua_State *L); + + // get_rotation(self) + static int l_get_rotation(lua_State *L); + // set_yaw(self, radians) static int l_set_yaw(lua_State *L); -- cgit v1.2.3