-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
bevy_scene: Add SceneFilter
#6793
Changes from all commits
3116eb1
ddfb3d2
66de3b7
234ecea
90feb6f
82f44da
6e91779
bc4ca4c
b01e12b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,14 +45,13 @@ pub struct DynamicEntity { | |
|
||
impl DynamicScene { | ||
/// Create a new dynamic scene from a given scene. | ||
pub fn from_scene(scene: &Scene, type_registry: &AppTypeRegistry) -> Self { | ||
Self::from_world(&scene.world, type_registry) | ||
pub fn from_scene(scene: &Scene) -> Self { | ||
Self::from_world(&scene.world) | ||
} | ||
|
||
/// Create a new dynamic scene from a given world. | ||
pub fn from_world(world: &World, type_registry: &AppTypeRegistry) -> Self { | ||
let mut builder = | ||
DynamicSceneBuilder::from_world_with_type_registry(world, type_registry.clone()); | ||
pub fn from_world(world: &World) -> Self { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be a trait implementation? We could move this into an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, I just checked the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we could There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Possibly. I'm also starting to wonder if doing Maybe we save these changes for a followup PR to allow for further discussion (if any)? |
||
let mut builder = DynamicSceneBuilder::from_world(world); | ||
|
||
builder.extract_entities(world.iter_entities().map(|entity| entity.id())); | ||
builder.extract_resources(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a trait implementation? We could move this into an
impl From<&Scene> for DynamicScene
since it doesn't need the second argument anymore.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this makes sense as well. I'll do this too!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also decided to hold off on this. If anything, we can save this for a future PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm fine to leave this to follow-up.