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

ecs: use generational entity ids and other optimizations #504

Merged
merged 3 commits into from
Sep 18, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions assets/scenes/load_scene_example.scn
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
[
(
entity: 328997855,
entity: 0,
components: [
{
"type": "ComponentA",
"type": "ComponentB",
"map": {
"x": 3.0,
"y": 4.0,
"value": "hello",
},
},
],
),
(
entity: 404566393,
components: [
{
"type": "ComponentA",
"map": {
"x": 1.0,
"y": 2.0,
},
},
],
),
(
entity: 1,
components: [
{
"type": "ComponentB",
"type": "ComponentA",
"map": {
"value": "hello",
"x": 3.0,
"y": 4.0,
},
},
],
Expand Down
6 changes: 4 additions & 2 deletions crates/bevy_app/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ impl App {
}

pub fn update(&mut self) {
self.schedule.initialize(&mut self.resources);
self.schedule
.initialize(&mut self.world, &mut self.resources);
self.executor
.run(&mut self.schedule, &mut self.world, &mut self.resources);
}
Expand All @@ -69,7 +70,8 @@ impl App {
.unwrap_or_else(DefaultTaskPoolOptions::default)
.create_default_pools(&mut self.resources);

self.startup_schedule.initialize(&mut self.resources);
self.startup_schedule
.initialize(&mut self.world, &mut self.resources);
self.startup_executor.run(
&mut self.startup_schedule,
&mut self.world,
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ecs/hecs/benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ fn iterate_100k(b: &mut Bencher) {
world.spawn((Position(-(i as f32)), Velocity(i as f32)));
}
b.iter(|| {
for (mut pos, vel) in &mut world.query::<(&mut Position, &Velocity)>() {
for (mut pos, vel) in &mut world.query_mut::<(&mut Position, &Velocity)>() {
pos.0 += vel.0;
}
})
Expand Down
39 changes: 0 additions & 39 deletions crates/bevy_ecs/hecs/examples/format.rs

This file was deleted.

Loading