library: shape: enum: add deserialization
This commit is contained in:
parent
6aa5f2536c
commit
3f1a166edf
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue