1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Player: New get_look, set_look API

Deprecate get_look / set_look pitch / yaw
This commit is contained in:
raymoo 2016-06-17 12:57:27 -07:00 committed by paramat
parent 04fb10914c
commit fa0bbbf96d
4 changed files with 124 additions and 12 deletions

View file

@ -2679,10 +2679,20 @@ This is basically a reference to a C++ `ServerActiveObject`
* `get_player_velocity()`: returns `nil` if is not a player, otherwise a
table {x, y, z} representing the player's instantaneous velocity in nodes/s
* `get_look_dir()`: get camera direction as a unit vector
* `get_look_pitch()`: pitch in radians
* `get_look_yaw()`: yaw in radians (wraps around pretty randomly as of now)
* `set_look_pitch(radians)`: sets look pitch
* `set_look_yaw(radians)`: sets look yaw
* `get_look_vertical()`: pitch in radians
* Angle ranges between -pi/2 and pi/2, which are straight up and down respectively.
* `get_look_horizontal()`: yaw in radians
* Angle is counter-clockwise from the +z direction.
* `set_look_vertical(radians)`: sets look pitch
* radians - Angle from looking forward, where positive is downwards.
* `set_look_horizontal(radians)`: sets look yaw
* radians - Angle from the +z direction, where positive is counter-clockwise.
* `get_look_pitch()`: pitch in radians - Deprecated as broken. Use get_look_vertical.
* Angle ranges between -pi/2 and pi/2, which are straight down and up respectively.
* `get_look_yaw()`: yaw in radians - Deprecated as broken. Use get_look_horizontal.
* Angle is counter-clockwise from the +x direction.
* `set_look_pitch(radians)`: sets look pitch - Deprecated. Use set_look_vertical.
* `set_look_yaw(radians)`: sets look yaw - Deprecated. Use set_look_horizontal.
* `get_breath()`: returns players breath
* `set_breath(value)`: sets players breath
* values: