Skip to content

Commit da298a2

Browse files
paramatnerzhul
authored andcommittedDec 9, 2017
Pointed thing to face pos: Use 'eye height' object property (#6754)
1 parent 9c66901 commit da298a2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎builtin/common/misc_helpers.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,7 @@ end
670670
-- Returns the exact coordinate of a pointed surface
671671
--------------------------------------------------------------------------------
672672
function core.pointed_thing_to_face_pos(placer, pointed_thing)
673+
local eye_height = placer:get_properties().eye_height
673674
local eye_offset_first = placer:get_eye_offset()
674675
local node_pos = pointed_thing.under
675676
local camera_pos = placer:get_pos()
@@ -689,7 +690,7 @@ function core.pointed_thing_to_face_pos(placer, pointed_thing)
689690
end
690691

691692
local fine_pos = {[nc] = node_pos[nc] + offset}
692-
camera_pos.y = camera_pos.y + 1.625 + eye_offset_first.y / 10
693+
camera_pos.y = camera_pos.y + eye_height + eye_offset_first.y / 10
693694
local f = (node_pos[nc] + offset - camera_pos[nc]) / look_dir[nc]
694695

695696
for i = 1, #oc do

0 commit comments

Comments
 (0)
Please sign in to comment.