forked from minetest-mods/camera
Disable debugging messages
This commit is contained in:
parent
9aa8c2436f
commit
ba7f352909
38
init.lua
38
init.lua
@ -110,7 +110,7 @@ function camera:on_step(dtime)
|
|||||||
-- Calculate pitch and yaw if target_look_position defined
|
-- Calculate pitch and yaw if target_look_position defined
|
||||||
if target_look_position then
|
if target_look_position then
|
||||||
local vec_pos = vector.subtract(target_look_position, pos)
|
local vec_pos = vector.subtract(target_look_position, pos)
|
||||||
print("vec_pos "..dump(vec_pos))
|
--print("vec_pos "..dump(vec_pos))
|
||||||
|
|
||||||
-- Pitch
|
-- Pitch
|
||||||
local opp = vec_pos.y
|
local opp = vec_pos.y
|
||||||
@ -132,48 +132,48 @@ function camera:on_step(dtime)
|
|||||||
local yaw = opp/adj
|
local yaw = opp/adj
|
||||||
|
|
||||||
if math.abs(vec_pos.x) > math.abs(vec_pos.z) then
|
if math.abs(vec_pos.x) > math.abs(vec_pos.z) then
|
||||||
print("INVINVINVINVINVINVINVINVINVINV")
|
--print("INVINVINVINVINVINVINVINVINVINV")
|
||||||
yaw = adj/opp
|
yaw = adj/opp
|
||||||
if adj < 0 and opp < 0 then
|
if adj < 0 and opp < 0 then
|
||||||
print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!!!!!!")
|
--print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!!!!!!")
|
||||||
yaw = yaw + math.pi/2
|
yaw = yaw + math.pi/2
|
||||||
end
|
end
|
||||||
|
|
||||||
if adj > 0 and opp > 0 then
|
if adj > 0 and opp > 0 then
|
||||||
print("++++++++++++++++++++++++++++++!!!!!!")
|
--print("++++++++++++++++++++++++++++++!!!!!!")
|
||||||
yaw = yaw + math.pi + math.pi/2
|
yaw = yaw + math.pi + math.pi/2
|
||||||
end
|
end
|
||||||
|
|
||||||
if yaw < 0 then
|
if yaw < 0 then
|
||||||
print("BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB!!!!!!")
|
--print("BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB!!!!!!")
|
||||||
if opp > 0 then
|
if opp > 0 then
|
||||||
print("OPP>0 OPP>0 OPP>0 OPP>0 OPP>0 OPP>0 OPP>0 OPP>0 OPP>0")
|
--print("OPP>0 OPP>0 OPP>0 OPP>0 OPP>0 OPP>0 OPP>0 OPP>0 OPP>0")
|
||||||
yaw = math.pi + math.pi/2 + yaw
|
yaw = math.pi + math.pi/2 + yaw
|
||||||
else
|
else
|
||||||
print("OPP<0 OPP<0 OPP<0 OPP<0 OPP<0 OPP<0 OPP<0 OPP<0 OPP<0 ")
|
--print("OPP<0 OPP<0 OPP<0 OPP<0 OPP<0 OPP<0 OPP<0 OPP<0 OPP<0 ")
|
||||||
yaw = math.pi/2 + yaw
|
yaw = math.pi/2 + yaw
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
print("NORMNORMNORMNORMNORMNORMNORMNORMNORM!!!!!!")
|
--print("NORMNORMNORMNORMNORMNORMNORMNORMNORM!!!!!!")
|
||||||
if adj < 0 and opp < 0 then
|
if adj < 0 and opp < 0 then
|
||||||
print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!!!!!!")
|
--print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!!!!!!")
|
||||||
yaw = yaw - math.pi
|
yaw = yaw - math.pi
|
||||||
end
|
end
|
||||||
|
|
||||||
if adj > 0 and opp > 0 then
|
if adj > 0 and opp > 0 then
|
||||||
print("++++++++++++++++++++++++++++++!!!!!!")
|
--print("++++++++++++++++++++++++++++++!!!!!!")
|
||||||
yaw = math.pi*2 - yaw
|
yaw = math.pi*2 - yaw
|
||||||
end
|
end
|
||||||
|
|
||||||
if yaw < 0 then
|
if yaw < 0 then
|
||||||
print("BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB!!!!!!")
|
--print("BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB!!!!!!")
|
||||||
if opp > 0 then
|
if opp > 0 then
|
||||||
print("OPP>0 OPP>0 OPP>0 OPP>0 OPP>0 OPP>0 OPP>0 OPP>0 OPP>0")
|
--print("OPP>0 OPP>0 OPP>0 OPP>0 OPP>0 OPP>0 OPP>0 OPP>0 OPP>0")
|
||||||
yaw = math.pi - yaw
|
yaw = math.pi - yaw
|
||||||
else
|
else
|
||||||
print("OPP<0 OPP<0 OPP<0 OPP<0 OPP<0 OPP<0 OPP<0 OPP<0 OPP<0 ")
|
--print("OPP<0 OPP<0 OPP<0 OPP<0 OPP<0 OPP<0 OPP<0 OPP<0 OPP<0 ")
|
||||||
yaw = math.pi*2 - yaw
|
yaw = math.pi*2 - yaw
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -193,12 +193,12 @@ function camera:on_step(dtime)
|
|||||||
-- Modify yaw and pitch to match driver (player)
|
-- Modify yaw and pitch to match driver (player)
|
||||||
self.object:set_look_pitch(self.driver:get_look_pitch())
|
self.object:set_look_pitch(self.driver:get_look_pitch())
|
||||||
self.object:set_look_yaw(self.driver:get_look_yaw())
|
self.object:set_look_yaw(self.driver:get_look_yaw())
|
||||||
print("look pitch "..dump(self.driver:get_look_pitch()))
|
--print("look pitch "..dump(self.driver:get_look_pitch()))
|
||||||
print("look vertical "..dump(self.driver:get_look_vertical()))
|
--print("look vertical "..dump(self.driver:get_look_vertical()))
|
||||||
print("look yaw "..dump(self.driver:get_look_yaw()))
|
--print("look yaw "..dump(self.driver:get_look_yaw()))
|
||||||
print("look horizontal "..dump(self.driver:get_look_horizontal()))
|
--print("look horizontal "..dump(self.driver:get_look_horizontal()))
|
||||||
print("velocity "..dump(self.object:getvelocity()))
|
--print("velocity "..dump(self.object:getvelocity()))
|
||||||
print("look dir "..dump(dir))
|
--print("look dir "..dump(dir))
|
||||||
|
|
||||||
-- Get controls
|
-- Get controls
|
||||||
local ctrl = self.driver:get_player_control()
|
local ctrl = self.driver:get_player_control()
|
||||||
|
Loading…
Reference in New Issue
Block a user