1
0
mirror of https://github.com/Uberi/Minetest-WorldEdit.git synced 2024-12-26 10:40:40 +01:00

Use eye_height property for brush raytracing

This commit is contained in:
sfan5 2019-09-06 17:45:51 +02:00
parent f589c988b1
commit a1b6a34e61

View File

@ -51,7 +51,8 @@ local brush_on_use = function(itemstack, placer)
return false return false
end end
local raybegin = vector.add(placer:get_pos(), {x=0, y=2, z=0}) -- player head local raybegin = vector.add(placer:get_pos(),
{x=0, y=placer:get_properties().eye_height, z=0})
local rayend = vector.add(raybegin, vector.multiply(placer:get_look_dir(), BRUSH_MAX_DIST)) local rayend = vector.add(raybegin, vector.multiply(placer:get_look_dir(), BRUSH_MAX_DIST))
local ray = minetest.raycast(raybegin, rayend, false, true) local ray = minetest.raycast(raybegin, rayend, false, true)
local pointed_thing = ray:next() local pointed_thing = ray:next()