use glam_det::{Point3, UnitVec3, Vec3};
pub struct ConvexHull {
pub points: Vec<Point3>,
pub bounding_planes: Vec<HalfPlane>,
pub face_indices_start: Vec<u32>,
pub face_vertex_indices: Vec<u32>,
pub center: Vec3,
pub volume: f32,
pub shift_center: Option<Vec3>,
}
pub struct HalfPlane {
pub center: Point3,
pub normal: UnitVec3,
pub offset: f32,
}
impl HalfPlane {
#[inline]
pub(crate) fn new(center: Point3, normal: UnitVec3, offset: f32) -> Self {
Self {
center,
normal,
offset,
}
}
}
impl ConvexHull {
#[inline]
pub(crate) fn with_points(points: Vec<Point3>) -> Self {
Self {
points,
bounding_planes: vec![],
face_indices_start: vec![],
face_vertex_indices: vec![],
center: Vec3::default(),
volume: 1.0,
shift_center: None,
}
}
}