Skip to main content

mraphics_core/animation/
animation.rs

1use crate::{MeshPool, Scene, animation::Action};
2use std::{cell::RefCell, rc::Rc};
3
4pub trait Animation<'res> {
5    fn into_action(
6        self,
7        mesh_pool: Rc<RefCell<MeshPool>>,
8        scene: Rc<RefCell<Scene>>,
9    ) -> Action<'res>;
10}
11
12/// A trait that specifies a struct can both:
13/// - Generate an intermediate representation
14/// - Update self from an intermediate representation
15pub trait Representable {
16    type Intermediate;
17
18    fn as_intermediate(&self) -> Self::Intermediate;
19    fn update_from_intermediate(&mut self, repr: &Self::Intermediate);
20}