diff --git a/src/shape/mod.rs b/src/shape/mod.rs index e4af43b..c8b79cd 100644 --- a/src/shape/mod.rs +++ b/src/shape/mod.rs @@ -3,10 +3,13 @@ use bvh::{ aabb::{Bounded, AABB}, ray::Ray, }; +use serde::Deserialize; /// All the existing `Shape` implementation. +#[serde(tag = "type")] +#[serde(rename_all = "lowercase")] #[enum_dispatch::enum_dispatch] -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Deserialize)] pub enum ShapeEnum { Sphere, Triangle,