summaryrefslogtreecommitdiff
path: root/src/clientiface.cpp
diff options
context:
space:
mode:
authorCoderForTheBetter <marcumjp@gmail.com>2018-11-28 03:38:50 -0500
committerLoïc Blot <nerzhul@users.noreply.github.com>2018-11-28 09:38:50 +0100
commitfaa358e797128ab07bb5644ce305a832d59e5596 (patch)
treedcf05ef0611b839503c4845fd89ad9519ee1c4bb /src/clientiface.cpp
parent9519d57017cfa28eb4f2fbf3c780f826017bbb00 (diff)
downloadminetest-faa358e797128ab07bb5644ce305a832d59e5596.tar.gz
minetest-faa358e797128ab07bb5644ce305a832d59e5596.tar.bz2
minetest-faa358e797128ab07bb5644ce305a832d59e5596.zip
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).
Diffstat (limited to 'src/clientiface.cpp')
-rw-r--r--src/clientiface.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/clientiface.cpp b/src/clientiface.cpp
index 53c3fe9cd..a55e0f7b5 100644
--- a/src/clientiface.cpp
+++ b/src/clientiface.cpp
@@ -134,8 +134,8 @@ void RemoteClient::GetNextBlocks (
// Camera position and direction
v3f camera_pos = sao->getEyePosition();
v3f camera_dir = v3f(0,0,1);
- camera_dir.rotateYZBy(sao->getPitch());
- camera_dir.rotateXZBy(sao->getYaw());
+ camera_dir.rotateYZBy(sao->getLookPitch());
+ camera_dir.rotateXZBy(sao->getRotation().Y);
/*infostream<<"camera_dir=("<<camera_dir.X<<","<<camera_dir.Y<<","
<<camera_dir.Z<<")"<<std::endl;*/