pub struct Scene { /* private fields */ }Expand description
Records a scene imperatively, manim-style: add, play, wait. Nothing renders here.
Implementations§
Source§impl Scene
impl Scene
Sourcepub fn state(&self) -> &SceneState
pub fn state(&self) -> &SceneState
The scene as of the current time, e.g. for positioning relative to other mobjects.
Sourcepub fn play(&mut self, anim: impl Animation + 'static)
pub fn play(&mut self, anim: impl Animation + 'static)
Plans anim against the current state, records it and advances time past it.
Sourcepub fn always(
&mut self,
id: MobjectId,
f: impl Fn(&SceneState, f32) -> VState + Send + Sync + 'static,
)
pub fn always( &mut self, id: MobjectId, f: impl Fn(&SceneState, f32) -> VState + Send + Sync + 'static, )
From now on, mobject id is f(scene, secs_since_now) at every frame, until removed.
f sees the scene as animated plus the output of updaters registered before it, so
register in dependency order. Animations still plan against the un-updated state.
Sourcepub fn bake(self) -> BakedTimeline
pub fn bake(self) -> BakedTimeline
Finishes recording.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Scene
impl !UnwindSafe for Scene
impl Freeze for Scene
impl Send for Scene
impl Sync for Scene
impl Unpin for Scene
impl UnsafeUnpin for Scene
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more