library: shape: enum: add deserialization

This commit is contained in:
Bruno BELANYI 2020-03-18 15:42:25 +01:00
parent 6aa5f2536c
commit 3f1a166edf

View file

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