height dependend visibility on radar
This commit is contained in:
parent
a91f2e9cb2
commit
343cb555a5
@ -108,6 +108,18 @@ function airutils.on_step(self,dtime,colinfo)
|
||||
|
||||
-- physics comes first
|
||||
local vel = self.object:get_velocity()
|
||||
local pos = self.object:get_pos()
|
||||
local props = self.object:get_properties()
|
||||
|
||||
-- handle visibility on radar
|
||||
if (pos and pos.y < airutils.radarMinHeight and props.show_on_minimap) then
|
||||
props.show_on_minimap = false
|
||||
self.object:set_properties(props)
|
||||
end
|
||||
if (pos and pos.y >= airutils.radarMinHeight and not props.show_on_minimap) then
|
||||
props.show_on_minimap = true
|
||||
self.object:set_properties(props)
|
||||
end
|
||||
|
||||
if colinfo then
|
||||
self.isonground = colinfo.touching_ground
|
||||
|
@ -3,4 +3,6 @@
|
||||
--
|
||||
airutils.vector_up = vector.new(0, 1, 0)
|
||||
|
||||
--set min y-pos above which airplanes are seen on radar
|
||||
airutils.radarMinHeight = 30
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user