pub struct VertexScoreTable { /* private fields */ }Expand description
Caller-defined vertex-cache scores; an opt-in extension not in C++ meshoptimizer.
Cache score zero is for a vertex outside the cache; entries 1 through 16
correspond to most to least recently used. Live-valence scores cover 0 through
8 remaining triangle references; larger valences use entry 8. The cache size
and valence clamp cannot be changed. Default reproduces the standard table.
Implementations§
Source§impl VertexScoreTable
impl VertexScoreTable
Sourcepub fn new(cache: &[f32], live: &[f32]) -> Result<Self, Error>
pub fn new(cache: &[f32], live: &[f32]) -> Result<Self, Error>
Copy and validate exactly 17 cache scores and 9 live-valence scores. Construction allocates no heap storage and needs no workspace.
§Errors
InvalidParameter if either length differs or any score is non-finite.
Sourcepub fn cache_scores(&self) -> &[f32; 17]
pub fn cache_scores(&self) -> &[f32; 17]
Cache-position scores, including the outside-cache score at zero.
Sourcepub fn live_scores(&self) -> &[f32; 9]
pub fn live_scores(&self) -> &[f32; 9]
Live-valence scores; valences above eight use the final entry.
Trait Implementations§
Source§impl Clone for VertexScoreTable
impl Clone for VertexScoreTable
Source§impl Debug for VertexScoreTable
impl Debug for VertexScoreTable
Source§impl Default for VertexScoreTable
impl Default for VertexScoreTable
Source§impl PartialEq for VertexScoreTable
impl PartialEq for VertexScoreTable
impl StructuralPartialEq for VertexScoreTable
Auto Trait Implementations§
impl Forget for VertexScoreTable
impl Freeze for VertexScoreTable
impl RefUnwindSafe for VertexScoreTable
impl Send for VertexScoreTable
impl Sync for VertexScoreTable
impl Unpin for VertexScoreTable
impl UnsafeUnpin for VertexScoreTable
impl UnwindSafe for VertexScoreTable
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