removed support for any other game on camera reposition method

This commit is contained in:
Alexsandro Percy 2023-08-19 10:08:08 -03:00
parent 21928c277c
commit 57937e7b18

View File

@ -751,27 +751,30 @@ 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)
if roll < -0.4 then roll = -0.4 end
if roll > 0.4 then roll = 0.4 end
local player_properties = player:get_properties()
local new_eye_offset = vector.new() local new_eye_offset = vector.new()
if airutils.is_minetest then
if roll < -0.4 then roll = -0.4 end
if roll > 0.4 then roll = 0.4 end
local eye_y = -5 local player_properties = player:get_properties()
if airutils.detect_player_api(player) == 1 then
--minetest.chat_send_all("1")
eye_y = 0.5
end
if airutils.detect_player_api(player) == 2 then
--minetest.chat_send_all("2")
eye_y = -5
end
local z, y = airutils.get_xz_from_hipotenuse(0, eye_y, pitch, player_properties.eye_height) local eye_y = -5
new_eye_offset.z = z*7 if airutils.detect_player_api(player) == 1 then
new_eye_offset.y = y*1.5 --minetest.chat_send_all("1")
local x, _ = airutils.get_xz_from_hipotenuse(0, eye_y, roll, player_properties.eye_height) eye_y = 0.5
new_eye_offset.x = -x*15 end
if airutils.detect_player_api(player) == 2 then
--minetest.chat_send_all("2")
eye_y = -5
end
local z, y = airutils.get_xz_from_hipotenuse(0, eye_y, pitch, player_properties.eye_height)
new_eye_offset.z = z*7
new_eye_offset.y = y*1.5
local x, _ = airutils.get_xz_from_hipotenuse(0, eye_y, roll, player_properties.eye_height)
new_eye_offset.x = -x*15
return new_eye_offset
end
return new_eye_offset return new_eye_offset
end end