Skip to content

Commit

Permalink
extra extras
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Jan 20, 2022
1 parent 11eab81 commit 7289b0d
Showing 1 changed file with 24 additions and 10 deletions.
34 changes: 24 additions & 10 deletions crates/bevy_gltf/src/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,16 +550,20 @@ 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 pbr = parent.spawn_bundle(PbrBundle {
mesh: load_context.get_handle(mesh_asset_path),
material: load_context.get_handle(material_asset_path),
..Default::default()
});
pbr.insert(Aabb::from_min_max(
Vec3::from_slice(&bounds.min),
Vec3::from_slice(&bounds.max),
));
if let Some(extras) = primitive.extras() {
pbr.insert(super::GltfExtras {
value: extras.get().to_string(),
});
}
}
}

Expand All @@ -579,6 +583,11 @@ fn load_node(
if let Some(name) = light.name() {
entity.insert(Name::new(name.to_string()));
}
if let Some(extras) = light.extras() {
entity.insert(super::GltfExtras {
value: extras.get().to_string(),
});
}
}
gltf::khr_lights_punctual::Kind::Point => {
let mut entity = parent.spawn_bundle(PointLightBundle {
Expand All @@ -597,6 +606,11 @@ fn load_node(
if let Some(name) = light.name() {
entity.insert(Name::new(name.to_string()));
}
if let Some(extras) = light.extras() {
entity.insert(super::GltfExtras {
value: extras.get().to_string(),
});
}
}
gltf::khr_lights_punctual::Kind::Spot {
inner_cone_angle: _inner_cone_angle,
Expand Down

0 comments on commit 7289b0d

Please sign in to comment.