does line-of-sight work
i asked this before but got no answer, so i moved it here hoping for a better response - otherwise it means that nobody knows and that leaves me to have to fix my broken line-of-sight code and doing that makes me go grrrr
so, does Line Of Sight work?
where:
local p1={x=pos1.x,y=pos1.y,z=pos1.z}
local p2={x=pos2.x,y=pos2.y,z=pos2.z}
local los = minetest..line_of_sight(p1,p2,1)
so los will be true if there is a clear line of sight between p1 and p2, or false if there is not?
what about glass?
what about blocks adjacent only at the corners? like:
XX1XXX
XXX2XX
would that be false, or true?
(from the api)
minetest.line_of_sight(pos1,pos2,stepsize) ->true/false
^ checkif there is a direct line of sight between pos1 and pos2
^ pos1 First position
^ pos2 Second position
^ stepsize smaller gives more accurate results but requires more computing
time. Default is 1.
BAH! There is a tree between me and it, then I am standing on top of it, jumping up and down on it, and it always says "false"!
the cpp for it is pathfinder.cpp, but
local zpath = {}
zpath = minetest.find_path(p1,p2,10,1,1,"") --default algo
if zpath then ....
doesn't work either - says "14:41:04: ERROR[ServerThread]: invalid startposIndex: (10,10,10)Realpos: (156,32,123)"
p1 is 156,32,123 and p2 is 156.46600341797,32.5,123.71800994873 when i was standing on top of it
oh and the minetest is from 2 days ago, compiled with git clone blah blah blah
thank you...this is driving me nutso - i dun wanna fix my broke code waaaa
so, does Line Of Sight work?
where:
local p1={x=pos1.x,y=pos1.y,z=pos1.z}
local p2={x=pos2.x,y=pos2.y,z=pos2.z}
local los = minetest..line_of_sight(p1,p2,1)
so los will be true if there is a clear line of sight between p1 and p2, or false if there is not?
what about glass?
what about blocks adjacent only at the corners? like:
XX1XXX
XXX2XX
would that be false, or true?
(from the api)
minetest.line_of_sight(pos1,pos2,stepsize) ->true/false
^ checkif there is a direct line of sight between pos1 and pos2
^ pos1 First position
^ pos2 Second position
^ stepsize smaller gives more accurate results but requires more computing
time. Default is 1.
BAH! There is a tree between me and it, then I am standing on top of it, jumping up and down on it, and it always says "false"!
the cpp for it is pathfinder.cpp, but
local zpath = {}
zpath = minetest.find_path(p1,p2,10,1,1,"") --default algo
if zpath then ....
doesn't work either - says "14:41:04: ERROR[ServerThread]: invalid startposIndex: (10,10,10)Realpos: (156,32,123)"
p1 is 156,32,123 and p2 is 156.46600341797,32.5,123.71800994873 when i was standing on top of it
oh and the minetest is from 2 days ago, compiled with git clone blah blah blah
thank you...this is driving me nutso - i dun wanna fix my broke code waaaa