pub struct M2Material {
pub flags: M2RenderFlags,
pub blend_mode: M2BlendMode,
}Expand description
Represents a material layer (render flags) in an M2 model This corresponds to the ModelRenderFlagsM2 structure in WMVx
Fields§
§flags: M2RenderFlagsRender flags
blend_mode: M2BlendModeBlend mode
Implementations§
Source§impl M2Material
impl M2Material
Sourcepub fn parse<R: Read>(reader: &mut R, _version: u32) -> Result<Self>
pub fn parse<R: Read>(reader: &mut R, _version: u32) -> Result<Self>
Parse a material from a reader based on the M2 version
Sourcepub fn write<W: Write>(&self, writer: &mut W, _version: u32) -> Result<()>
pub fn write<W: Write>(&self, writer: &mut W, _version: u32) -> Result<()>
Write a material to a writer based on the M2 version
Sourcepub fn convert(&self, _target_version: M2Version) -> Self
pub fn convert(&self, _target_version: M2Version) -> Self
Convert this material to a different version
Sourcepub fn new(blend_mode: M2BlendMode) -> Self
pub fn new(blend_mode: M2BlendMode) -> Self
Create a new material with default values
Sourcepub fn size_in_bytes(_version: M2Version) -> usize
pub fn size_in_bytes(_version: M2Version) -> usize
Calculate the size of this material in bytes for a specific version
Trait Implementations§
Source§impl Clone for M2Material
impl Clone for M2Material
Source§fn clone(&self) -> M2Material
fn clone(&self) -> M2Material
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 M2Material
impl RefUnwindSafe for M2Material
impl Send for M2Material
impl Sync for M2Material
impl Unpin for M2Material
impl UnwindSafe for M2Material
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