hideentity/showentity usage

Blitz3D Forums/Blitz3D Programming/hideentity/showentity usage

(tu) sinu(Posted 2003) [#1]
if im hiding and showing alot of entities should i add a flag for wether they are hidden or not so as to stop running hideentity and showentity on every entity be it hidden or not?
eg

type EntityMesh

field mesh, HiddenStatus

end type

for m.EntityMesh = each EntityMesh

if m\HiddenStatus = 1

if EntityInView(m\mesh,camera)
ShowEntity m\mesh
m\HiddenStatus = 0
endif

elseif m\HiddenStatus = 0

if not EntityInView(m\mesh,camera)
HideEntity m\mesh
m\HiddenStatus = 1
endif

endif

next


puki(Posted 2003) [#2]
"Sinu", I'm no expert, but can it not be done with smaller code by "toggling" with a "Not","If",Else" structure (If "whatever" Then ShowEntity "xxx" Else HideEntity "xxx"? Taking into account Entityvisible=Not Entityvisible

Edited post - mmm, perhaps not thinking about it with aftersight (the above just instantly popped into my head) - sorry


(tu) sinu(Posted 2003) [#3]
looks like blitz handle hiding and showing large numbers of entities easily enough without putting in a check.