diff --git a/doppler/Cargo.toml b/doppler/Cargo.toml index e274ed6..f5d5078 100644 --- a/doppler/Cargo.toml +++ b/doppler/Cargo.toml @@ -9,7 +9,7 @@ gl = "0.14.0" imgui={version="0.4.0", optional=true} imgui-winit-support = {version="0.4.0", optional=true} imgui-opengl-renderer = {version="0.8", optional = true} -cgmath = "0.17.0" +cgmath = {version="0.17.0", features=["serde"]} imgui-inspect = {version="0.5.0", optional = true} imgui-inspect-derive = {version="0.5.0", optional= true} tobj = "2.0.2" @@ -18,6 +18,8 @@ log = "0.4.11" simple-logging = "2.0.2" image2 = { git = "https://github.com/Leinnan/image2-rs", branch="legacy", default-features = false, features=["io"] } glutin = "0.24.1" +serde = { version = "1.0.117", features = ["derive"] } +serde_json = "1.0.59" [features] default = ["imgui_inspect"] diff --git a/doppler/src/components.rs b/doppler/src/components.rs index d0ead36..2e10cc5 100644 --- a/doppler/src/components.rs +++ b/doppler/src/components.rs @@ -7,8 +7,9 @@ use cgmath::{vec3, Matrix4, Rad, Vector3}; use imgui; #[cfg(feature = "imgui_inspect")] use imgui_inspect_derive::Inspect; +use serde::{Deserialize, Serialize}; -#[derive(Clone, Copy, Debug)] +#[derive(Deserialize, Serialize,Clone, Copy, Debug)] #[cfg_attr(feature = "imgui_inspect", derive(Inspect))] pub struct Transform { #[cfg_attr(feature = "imgui_inspect", inspect(proxy_type = "CgmathVec3f32"))] diff --git a/doppler/src/lib.rs b/doppler/src/lib.rs index 4a08825..b5bb626 100644 --- a/doppler/src/lib.rs +++ b/doppler/src/lib.rs @@ -3,6 +3,7 @@ pub extern crate imgui; pub extern crate log; pub extern crate simple_logging; +pub use serde; pub use cgmath as math; pub use glutin; pub use imgui_inspect;