diff options
author | Paramat <paramat@users.noreply.github.com> | 2017-12-09 13:30:26 +0000 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-12-09 14:30:26 +0100 |
commit | da298a26ff3a412dda0caadddbfa4a92276daea3 (patch) | |
tree | c5bbcc765ac15c360358f4bf0fe19a6a9f22c963 /builtin | |
parent | 9c669016d1578a5c62f932c6ccb7a2b4b1e21f0a (diff) | |
download | minetest-da298a26ff3a412dda0caadddbfa4a92276daea3.tar.gz minetest-da298a26ff3a412dda0caadddbfa4a92276daea3.tar.bz2 minetest-da298a26ff3a412dda0caadddbfa4a92276daea3.zip |
Pointed thing to face pos: Use 'eye height' object property (#6754)
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/common/misc_helpers.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/common/misc_helpers.lua b/builtin/common/misc_helpers.lua index eccacba4f..01237f265 100644 --- a/builtin/common/misc_helpers.lua +++ b/builtin/common/misc_helpers.lua @@ -670,6 +670,7 @@ end -- Returns the exact coordinate of a pointed surface -------------------------------------------------------------------------------- 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 node_pos = pointed_thing.under local camera_pos = placer:get_pos() @@ -689,7 +690,7 @@ function core.pointed_thing_to_face_pos(placer, pointed_thing) end 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] for i = 1, #oc do |