Pointed thing to face pos: Use 'eye height' object property (#6754)

master
Paramat 2017-12-09 13:30:26 +00:00 committed by Loïc Blot
parent 9c669016d1
commit da298a26ff
1 changed files with 2 additions and 1 deletions

View File

@ -670,6 +670,7 @@ end
-- Returns the exact coordinate of a pointed surface -- Returns the exact coordinate of a pointed surface
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
function core.pointed_thing_to_face_pos(placer, pointed_thing) function core.pointed_thing_to_face_pos(placer, pointed_thing)
local eye_height = placer:get_properties().eye_height
local eye_offset_first = placer:get_eye_offset() local eye_offset_first = placer:get_eye_offset()
local node_pos = pointed_thing.under local node_pos = pointed_thing.under
local camera_pos = placer:get_pos() local camera_pos = placer:get_pos()
@ -689,7 +690,7 @@ function core.pointed_thing_to_face_pos(placer, pointed_thing)
end end
local fine_pos = {[nc] = node_pos[nc] + offset} local fine_pos = {[nc] = node_pos[nc] + offset}
camera_pos.y = camera_pos.y + 1.625 + eye_offset_first.y / 10 camera_pos.y = camera_pos.y + eye_height + eye_offset_first.y / 10
local f = (node_pos[nc] + offset - camera_pos[nc]) / look_dir[nc] local f = (node_pos[nc] + offset - camera_pos[nc]) / look_dir[nc]
for i = 1, #oc do for i = 1, #oc do