pub struct ClipFlipbook { /* private fields */ }Expand description
CPU-side decoded animated voxel clip: every frame’s SpriteDense
is cached at construction, so per-frame playback is a grid select
— not the per-frame voxel-volume decode draw_sprite_dda pays each
call. The CPU counterpart to the GPU flipbook (VCL.2). Build once from
a DecodedClip, then draw_frame the
active frame each render.
Implementations§
Source§impl ClipFlipbook
impl ClipFlipbook
Sourcepub fn empty() -> Self
pub fn empty() -> Self
An empty flipbook (no frames) — a tombstone for a removed clip;
draw_frame always draws nothing.
Sourcepub fn from_decoded(clip: &DecodedClip) -> Self
pub fn from_decoded(clip: &DecodedClip) -> Self
Decode + cache every frame of clip (one SpriteDense each).
pub fn frame_count(&self) -> usize
Sourcepub fn frame(&self, frame: usize) -> Option<&SpriteDense>
pub fn frame(&self, frame: usize) -> Option<&SpriteDense>
Borrow frame frame’s cached dense grid, if in range.
Sourcepub fn set_frame(&mut self, frame: usize, dense: SpriteDense) -> bool
pub fn set_frame(&mut self, frame: usize, dense: SpriteDense) -> bool
Replace one frame’s cached dense grid in place — the CPU side of an
editor’s single-frame edit (no re-decode of the other frames).
Returns false if frame is out of range.
Sourcepub fn draw_frame(
&self,
fb: &mut [u32],
zb: &mut [f32],
pitch_pixels: usize,
width: u32,
height: u32,
cam: &CameraState,
settings: &OpticastSettings,
frame: usize,
pos: [f32; 3],
s: [f32; 3],
h: [f32; 3],
f: [f32; 3],
flags: u32,
) -> u32
pub fn draw_frame( &self, fb: &mut [u32], zb: &mut [f32], pitch_pixels: usize, width: u32, height: u32, cam: &CameraState, settings: &OpticastSettings, frame: usize, pos: [f32; 3], s: [f32; 3], h: [f32; 3], f: [f32; 3], flags: u32, ) -> u32
Draw frame frame at a world pose via draw_sprite_dense —
pos is the world pivot, s/h/f the model→world basis columns.
Returns pixels written (0 if frame is out of range).
Sourcepub fn draw_frame_shaded(
&self,
fb: &mut [u32],
zb: &mut [f32],
pitch_pixels: usize,
width: u32,
height: u32,
cam: &CameraState,
settings: &OpticastSettings,
frame: usize,
pos: [f32; 3],
s: [f32; 3],
h: [f32; 3],
f: [f32; 3],
flags: u32,
shade_ctx: Option<SpriteShade<'_>>,
) -> u32
pub fn draw_frame_shaded( &self, fb: &mut [u32], zb: &mut [f32], pitch_pixels: usize, width: u32, height: u32, cam: &CameraState, settings: &OpticastSettings, frame: usize, pos: [f32; 3], s: [f32; 3], h: [f32; 3], f: [f32; 3], flags: u32, shade_ctx: Option<SpriteShade<'_>>, ) -> u32
Draw frame frame, optionally with a translucent material (TV stage)
— the draw_sprite_dense_shaded counterpart of
draw_frame. shade_ctx == None (or an opaque
effective material) renders the frame opaque, unchanged.
Auto Trait Implementations§
impl Freeze for ClipFlipbook
impl RefUnwindSafe for ClipFlipbook
impl Send for ClipFlipbook
impl Sync for ClipFlipbook
impl Unpin for ClipFlipbook
impl UnsafeUnpin for ClipFlipbook
impl UnwindSafe for ClipFlipbook
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more