blender_mesh/bounding_box.rs
1use nalgebra::Point3;
2
3/// The bounding box that encompasses a mesh. This will usually come from Blender as a z_up
4/// coordinate system bounding box that you'll later convert to be y_up.
5///
6/// If your mesh is parented to an armature then this is the bounding box of your mesh in its
7/// bind pose.
8#[derive(Debug, Serialize, Deserialize, PartialEq, Copy, Clone)]
9pub struct BoundingBox {
10 /// The corner with the lowest x, y and z values
11 pub min_corner: Point3<f32>,
12 /// The corner with the greatest x, y and z values
13 pub max_corner: Point3<f32>,
14}
15
16impl Default for BoundingBox {
17 fn default() -> Self {
18 BoundingBox {
19 min_corner: Point3::new(0.0, 0.0, 0.0),
20 max_corner: Point3::new(0.0, 0.0, 0.0),
21 }
22 }
23}