diff --git a/crates/bevy_render/src/mesh/shape/mod.rs b/crates/bevy_render/src/mesh/shape/mod.rs index e2aa285d2085a..6e2b06f072608 100644 --- a/crates/bevy_render/src/mesh/shape/mod.rs +++ b/crates/bevy_render/src/mesh/shape/mod.rs @@ -49,6 +49,17 @@ impl Box { min_z: -z_length / 2.0, } } + + pub fn from_min_max(min: Vec3, max: Vec3) -> Box { + Box { + max_x: max.x, + min_x: min.x, + max_y: max.y, + min_y: min.y, + max_z: max.z, + min_z: min.z, + } + } } impl Default for Box {