pub struct MaterialLibrary {
pub materials: Vec<PbrMaterial>,
}Expand description
A flat list of PbrMaterial entries indexed by position.
Fields§
§materials: Vec<PbrMaterial>Implementations§
Source§impl MaterialLibrary
impl MaterialLibrary
Sourcepub fn add(&mut self, mat: PbrMaterial) -> usize
pub fn add(&mut self, mat: PbrMaterial) -> usize
Append a material and return its index.
Sourcepub fn get(&self, idx: usize) -> Option<&PbrMaterial>
pub fn get(&self, idx: usize) -> Option<&PbrMaterial>
Retrieve a material by index.
Sourcepub fn by_name(&self, name: &str) -> Option<&PbrMaterial>
pub fn by_name(&self, name: &str) -> Option<&PbrMaterial>
Find the first material whose name matches name.
Trait Implementations§
Source§impl Clone for MaterialLibrary
impl Clone for MaterialLibrary
Source§fn clone(&self) -> MaterialLibrary
fn clone(&self) -> MaterialLibrary
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 moreSource§impl Debug for MaterialLibrary
impl Debug for MaterialLibrary
Source§impl Default for MaterialLibrary
impl Default for MaterialLibrary
Source§fn default() -> MaterialLibrary
fn default() -> MaterialLibrary
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MaterialLibrary
impl RefUnwindSafe for MaterialLibrary
impl Send for MaterialLibrary
impl Sync for MaterialLibrary
impl Unpin for MaterialLibrary
impl UnsafeUnpin for MaterialLibrary
impl UnwindSafe for MaterialLibrary
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