pub struct GeoCache {
pub name: String,
pub fps: f32,
pub vertex_count: usize,
pub frames: Vec<GeoCacheFrame>,
}Expand description
In-memory geometry cache containing all frames.
Fields§
§name: StringHuman-readable name (stored in the file header).
fps: f32Frames per second.
vertex_count: usizeNumber of vertices per frame (must be constant across all frames).
frames: Vec<GeoCacheFrame>All frames in chronological order.
Implementations§
Source§impl GeoCache
impl GeoCache
Sourcepub fn add_frame(&mut self, frame: GeoCacheFrame) -> Result<(), String>
pub fn add_frame(&mut self, frame: GeoCacheFrame) -> Result<(), String>
Append a frame. Returns an error when vertex counts mismatch, or when the frame has normals but the existing frames do not (or vice-versa).
Sourcepub fn frame_count(&self) -> usize
pub fn frame_count(&self) -> usize
Number of frames stored.
Sourcepub fn duration_seconds(&self) -> f32
pub fn duration_seconds(&self) -> f32
Total animation duration in seconds (last frame time, or 0 if empty).
Sourcepub fn get_frame(&self, index: usize) -> Option<&GeoCacheFrame>
pub fn get_frame(&self, index: usize) -> Option<&GeoCacheFrame>
Access a frame by index.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GeoCache
impl RefUnwindSafe for GeoCache
impl Send for GeoCache
impl Sync for GeoCache
impl Unpin for GeoCache
impl UnsafeUnpin for GeoCache
impl UnwindSafe for GeoCache
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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