parent
9a765d5e12
commit
21ad422f46
|
@ -755,7 +755,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "bevy_gltf_blueprints"
|
||||
version = "0.3.2"
|
||||
version = "0.3.3"
|
||||
dependencies = [
|
||||
"bevy",
|
||||
"bevy_gltf_components 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "bevy_gltf_blueprints"
|
||||
version = "0.3.2"
|
||||
version = "0.3.3"
|
||||
authors = ["Mark 'kaosat-dev' Moissette"]
|
||||
description = "Adds the ability to define Blueprints/Prefabs for [Bevy](https://bevyengine.org/) inside gltf files and spawn them in Bevy."
|
||||
homepage = "https://github.com/kaosat-dev/Blender_bevy_components_workflow"
|
||||
|
|
|
@ -21,10 +21,15 @@ pub fn compute_scene_aabbs(
|
|||
let root_entity = root_entity.2.first().unwrap();
|
||||
|
||||
// only recompute aabb if it has not already been done before
|
||||
if !blueprints_config.aabb_cache.contains_key(&name.to_string()) {
|
||||
if blueprints_config.aabb_cache.contains_key(&name.to_string()) {
|
||||
let aabb = blueprints_config
|
||||
.aabb_cache
|
||||
.get(&name.to_string())
|
||||
.expect("we should have the aabb available");
|
||||
commands.entity(*root_entity).insert(*aabb);
|
||||
} else {
|
||||
let aabb = compute_descendant_aabb(*root_entity, &children, &existing_aabbs);
|
||||
commands.entity(*root_entity).insert(aabb);
|
||||
|
||||
blueprints_config.aabb_cache.insert(name.to_string(), aabb);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue