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/serverenvironment.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/serverenvironment.cpp') diff --git a/src/serverenvironment.cpp b/src/serverenvironment.cpp index 3b2983825..efb93b9a2 100644 --- a/src/serverenvironment.cpp +++ b/src/serverenvironment.cpp @@ -340,8 +340,8 @@ void ActiveBlockList::update(std::vector &active_players, // only do this if this would add blocks if (player_ao_range > active_block_range) { v3f camera_dir = v3f(0,0,1); - camera_dir.rotateYZBy(playersao->getPitch()); - camera_dir.rotateXZBy(playersao->getYaw()); + camera_dir.rotateYZBy(playersao->getLookPitch()); + camera_dir.rotateXZBy(playersao->getRotation().Y); fillViewConeBlock(pos, player_ao_range, playersao->getEyePosition(), -- cgit v1.2.3