#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum ShDegree {
#[default]
Zero,
One,
Three,
}
impl ShDegree {
pub fn coeff_count(self) -> usize {
match self {
ShDegree::Zero => 3,
ShDegree::One => 12,
ShDegree::Three => 48,
}
}
}
pub struct GaussianSplatData {
pub positions: Vec<[f32; 3]>,
pub scales: Vec<[f32; 3]>,
pub rotations: Vec<[f32; 4]>,
pub opacities: Vec<f32>,
pub sh_coefficients: Vec<f32>,
pub sh_degree: ShDegree,
}
impl Default for GaussianSplatData {
fn default() -> Self {
Self {
positions: Vec::new(),
scales: Vec::new(),
rotations: Vec::new(),
opacities: Vec::new(),
sh_coefficients: Vec::new(),
sh_degree: ShDegree::Zero,
}
}
}