use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Copy, PartialEq, Default, Serialize, Deserialize)]
pub struct Point3 {
pub x: f64,
pub y: f64,
pub z: f64,
}
impl Point3 {
pub const fn new(x: f64, y: f64, z: f64) -> Self {
Self { x, y, z }
}
pub const fn xy(x: f64, y: f64) -> Self {
Self { x, y, z: 0.0 }
}
}
#[derive(Debug, Clone, Copy, PartialEq, Default, Serialize, Deserialize)]
pub struct Vec3 {
pub x: f64,
pub y: f64,
pub z: f64,
}
impl Vec3 {
pub const Z: Vec3 = Vec3 {
x: 0.0,
y: 0.0,
z: 1.0,
};
pub const fn new(x: f64, y: f64, z: f64) -> Self {
Self { x, y, z }
}
}
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
pub struct BBox {
pub min: Point3,
pub max: Point3,
}