Closed EmiOnGit closed 1 year ago
This behavior is caused by the extract_grass function.
Since Changed<Grass>
is only triggered on startup
Any idea @janhohenheim ?
Huh, strange. I'll check later
I tried replacing Changed<Grass>
by Changed<ComputedVisibility>
, but turns out ComputedVisibility
is mutably dereferenced and thus "changed" every frame. The best I can think of for now is removing the Changed
constraint, querying ChangeTrackers<Grass>
and adding the following to the loop for a tiny optimization:
if !tracker.is_changed() && entity_cache.contains(&entity) {
continue;
}
Quite suboptimal, because we'd iterate over all entities :/
Glad we came up to a similar conclusion..
Should be solved by #19
Describe the bug
If an entity is spawned with
ComputedVisibility
set to not visible, it will not registered and be invisible even ifComputedVisibility
is set to visible.To Reproduce
It can be seen in the load_many_chunks example. 100 chunks should be loaded into a grid but only the ones that are visible in the default view are registered. Use
cargo -r r --example load_many_chunks
to reproduce. Use keys Q,W,E,A,S,D for movement