mirror of
https://github.com/APercy/airutils.git
synced 2025-03-22 02:42:20 +00:00
improved support for any other game on camera reposition method
This commit is contained in:
parent
57937e7b18
commit
aa2f00212e
1 changed files with 20 additions and 21 deletions
|
@ -751,8 +751,8 @@ function airutils.get_xz_from_hipotenuse(orig_x, orig_z, yaw, distance)
|
||||||
end
|
end
|
||||||
|
|
||||||
function airutils.camera_reposition(player, pitch, roll)
|
function airutils.camera_reposition(player, pitch, roll)
|
||||||
local new_eye_offset = vector.new()
|
local new_eye_offset = player:get_eye_offset()
|
||||||
if airutils.is_minetest then
|
|
||||||
if roll < -0.4 then roll = -0.4 end
|
if roll < -0.4 then roll = -0.4 end
|
||||||
if roll > 0.4 then roll = 0.4 end
|
if roll > 0.4 then roll = 0.4 end
|
||||||
|
|
||||||
|
@ -773,8 +773,7 @@ function airutils.camera_reposition(player, pitch, roll)
|
||||||
new_eye_offset.y = y*1.5
|
new_eye_offset.y = y*1.5
|
||||||
local x, _ = airutils.get_xz_from_hipotenuse(0, eye_y, roll, player_properties.eye_height)
|
local x, _ = airutils.get_xz_from_hipotenuse(0, eye_y, roll, player_properties.eye_height)
|
||||||
new_eye_offset.x = -x*15
|
new_eye_offset.x = -x*15
|
||||||
return new_eye_offset
|
|
||||||
end
|
|
||||||
return new_eye_offset
|
return new_eye_offset
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue