Skip to content

Commit

Permalink
PR 4119
Browse files Browse the repository at this point in the history
  • Loading branch information
rparrett committed Mar 15, 2022
1 parent 206c423 commit 824e2d8
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions crates/bevy_gltf/src/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,16 +544,19 @@ fn load_node(
AssetPath::new_ref(load_context.path(), Some(&material_label));

let bounds = primitive.bounding_box();
parent
.spawn_bundle(PbrBundle {
mesh: load_context.get_handle(mesh_asset_path),
material: load_context.get_handle(material_asset_path),
..Default::default()
})
.insert(Aabb::from_min_max(
Vec3::from_slice(&bounds.min),
Vec3::from_slice(&bounds.max),
));
let mut mesh_entity = parent.spawn_bundle(PbrBundle {
mesh: load_context.get_handle(mesh_asset_path),
material: load_context.get_handle(material_asset_path),
..Default::default()
});
mesh_entity.insert(Aabb::from_min_max(
Vec3::from_slice(&bounds.min),
Vec3::from_slice(&bounds.max),
));

if let Some(name) = mesh.name() {
mesh_entity.insert(Name::new(name.to_string()));
}
}
}

Expand Down

0 comments on commit 824e2d8

Please sign in to comment.