pub struct PointCache {
pub header: PointCacheHeader,
pub frames: Vec<Vec<[f32; 3]>>,
}Expand description
In-memory point cache: per-frame vertex positions.
Fields§
§header: PointCacheHeader§frames: Vec<Vec<[f32; 3]>>All frames: outer = frame index, inner = per-vertex [x, y, z].
Implementations§
Source§impl PointCache
impl PointCache
Sourcepub fn new(vertex_count: usize, fps: f32) -> Self
pub fn new(vertex_count: usize, fps: f32) -> Self
Create a new empty cache for the given vertex count and frame rate.
Sourcepub fn add_frame(&mut self, positions: Vec<[f32; 3]>) -> Result<()>
pub fn add_frame(&mut self, positions: Vec<[f32; 3]>) -> Result<()>
Append a frame. Returns an error if the position count does not match.
Sourcepub fn frame_count(&self) -> usize
pub fn frame_count(&self) -> usize
Number of frames currently stored.
Sourcepub fn vertex_count(&self) -> usize
pub fn vertex_count(&self) -> usize
Number of vertices per frame.
Trait Implementations§
Source§impl Clone for PointCache
impl Clone for PointCache
Source§fn clone(&self) -> PointCache
fn clone(&self) -> PointCache
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PointCache
impl RefUnwindSafe for PointCache
impl Send for PointCache
impl Sync for PointCache
impl Unpin for PointCache
impl UnsafeUnpin for PointCache
impl UnwindSafe for PointCache
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