mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
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).
This commit is contained in:
parent
9519d57017
commit
faa358e797
18 changed files with 211 additions and 99 deletions
|
@ -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;*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue