Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
siler committed Mar 23, 2021
2 parents 34b58a9 + 81b53d1 commit 7c1a2f4
Show file tree
Hide file tree
Showing 55 changed files with 1,107 additions and 1,159 deletions.
277 changes: 154 additions & 123 deletions crates/bevy_ecs/src/system/commands.rs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/system/exclusive_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ mod tests {
) {
for entity in query.iter() {
*counter += 1;
commands.remove::<f32>(entity);
commands.entity(entity).remove::<f32>();
}
}

Expand Down
16 changes: 8 additions & 8 deletions crates/bevy_gltf/src/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,18 +296,18 @@ fn load_node(
) -> Result<(), GltfError> {
let transform = gltf_node.transform();
let mut gltf_error = None;
let node = world_builder.spawn((
let mut node = world_builder.spawn_bundle((
Transform::from_matrix(Mat4::from_cols_array_2d(&transform.matrix())),
GlobalTransform::identity(),
));

if let Some(name) = gltf_node.name() {
node.with(Name::new(name.to_string()));
node.insert(Name::new(name.to_string()));
}

// create camera node
if let Some(camera) = gltf_node.camera() {
node.with(VisibleEntities {
node.insert(VisibleEntities {
..Default::default()
});

Expand All @@ -325,12 +325,12 @@ fn load_node(
..Default::default()
};

node.with(Camera {
node.insert(Camera {
name: Some(base::camera::CAMERA_2D.to_owned()),
projection_matrix: orthographic_projection.get_projection_matrix(),
..Default::default()
});
node.with(orthographic_projection);
node.insert(orthographic_projection);
}
gltf::camera::Projection::Perspective(perspective) => {
let mut perspective_projection: PerspectiveProjection = PerspectiveProjection {
Expand All @@ -344,12 +344,12 @@ fn load_node(
if let Some(aspect_ratio) = perspective.aspect_ratio() {
perspective_projection.aspect_ratio = aspect_ratio;
}
node.with(Camera {
node.insert(Camera {
name: Some(base::camera::CAMERA_3D.to_owned()),
projection_matrix: perspective_projection.get_projection_matrix(),
..Default::default()
});
node.with(perspective_projection);
node.insert(perspective_projection);
}
}
}
Expand All @@ -374,7 +374,7 @@ fn load_node(
let material_asset_path =
AssetPath::new_ref(load_context.path(), Some(&material_label));

parent.spawn(PbrBundle {
parent.spawn_bundle(PbrBundle {
mesh: load_context.get_handle(mesh_asset_path),
material: load_context.get_handle(material_asset_path),
..Default::default()
Expand Down
6 changes: 3 additions & 3 deletions crates/bevy_scene/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ impl Command for SpawnScene {
}

pub trait SpawnSceneCommands {
fn spawn_scene(&mut self, scene: Handle<Scene>) -> &mut Self;
fn spawn_scene(&mut self, scene: Handle<Scene>);
}

impl<'a> SpawnSceneCommands for Commands<'a> {
fn spawn_scene(&mut self, scene_handle: Handle<Scene>) -> &mut Self {
self.add_command(SpawnScene { scene_handle })
fn spawn_scene(&mut self, scene_handle: Handle<Scene>) {
self.add(SpawnScene { scene_handle });
}
}

Expand Down
Loading

0 comments on commit 7c1a2f4

Please sign in to comment.