Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scene: only update components for entities in scene #1023

Merged
merged 1 commit into from
Dec 9, 2020

Conversation

mockersf
Copy link
Member

@mockersf mockersf commented Dec 7, 2020

fixes #1019

only update components for entities that are in the scene

can now render two scenes:
Screenshot 2020-12-07 at 18 30 13

looking at entities and their parents / children, they have the expected relations:

0v0 -> None - None // my light
1v0 -> None - None // my camera
2v0 -> None - Some(Children([9v0, 10v0, 11v0, 12v0, 13v0, 14v0])) // start of scene 1
15v0 -> None - Some(Children([22v0, 23v0, 24v0, 25v0, 26v0, 27v0])) // start of scene 2
3v0 -> Some(Parent(9v0)) - None
4v0 -> Some(Parent(10v0)) - None
5v0 -> Some(Parent(11v0)) - None
6v0 -> Some(Parent(12v0)) - None
7v0 -> Some(Parent(13v0)) - None
8v0 -> Some(Parent(14v0)) - None
16v0 -> Some(Parent(22v0)) - None
17v0 -> Some(Parent(23v0)) - None
18v0 -> Some(Parent(24v0)) - None
19v0 -> Some(Parent(25v0)) - None
20v0 -> Some(Parent(26v0)) - None
21v0 -> Some(Parent(27v0)) - None
9v0 -> Some(Parent(2v0)) - Some(Children([3v0]))
10v0 -> Some(Parent(2v0)) - Some(Children([4v0]))
11v0 -> Some(Parent(2v0)) - Some(Children([5v0]))
12v0 -> Some(Parent(2v0)) - Some(Children([6v0]))
13v0 -> Some(Parent(2v0)) - Some(Children([7v0]))
14v0 -> Some(Parent(2v0)) - Some(Children([8v0]))
22v0 -> Some(Parent(15v0)) - Some(Children([16v0]))
23v0 -> Some(Parent(15v0)) - Some(Children([17v0]))
24v0 -> Some(Parent(15v0)) - Some(Children([18v0]))
25v0 -> Some(Parent(15v0)) - Some(Children([19v0]))
26v0 -> Some(Parent(15v0)) - Some(Children([20v0]))
27v0 -> Some(Parent(15v0)) - Some(Children([21v0]))

@mockersf mockersf changed the title only update components for entities in map scene: only update components for entities in scene Dec 7, 2020
@Moxinilian Moxinilian added P-Crash A sudden unexpected crash A-ECS Entities, components, systems, and events labels Dec 9, 2020
@cart
Copy link
Member

cart commented Dec 9, 2020

Yup this makes sense to me. Good call!

@cart cart merged commit c54179b into bevyengine:master Dec 9, 2020
@fopsdev fopsdev mentioned this pull request Jan 24, 2021
@mockersf mockersf deleted the multiple_scene branch April 27, 2021 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events P-Crash A sudden unexpected crash
Projects
None yet
Development

Successfully merging this pull request may close these issues.

crash when spawning the same scene multiple times
3 participants