use crate::{
math::Transformable,
mesh::{EuclideanMeshType, MeshType},
};
pub trait FacePayload: Clone + Copy + PartialEq + Eq + std::fmt::Debug {
fn allocate() -> Self;
}
pub trait DefaultFacePayload: FacePayload + Default {}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub struct EmptyFacePayload<T: MeshType> {
_phantom: std::marker::PhantomData<T>,
}
impl<T: MeshType> FacePayload for EmptyFacePayload<T> {
fn allocate() -> Self {
Self {
_phantom: std::marker::PhantomData,
}
}
}
impl<T: MeshType> DefaultFacePayload for EmptyFacePayload<T> {}
impl<const D: usize, T: EuclideanMeshType<D>> Transformable<D> for EmptyFacePayload<T> {
type Rot = T::Rot;
type S = T::S;
type Trans = T::Trans;
type Vec = T::Vec;
fn transform(&mut self, _: &T::Trans) -> &mut Self {
self
}
fn lerp(&mut self, _: &Self, _: Self::S) -> &mut Self {
self
}
}