pub struct M2Light {
pub light_type: M2LightType,
pub bone_index: u16,
pub position: C3Vector,
pub ambient_color_animation: M2AnimationBlock<M2Color>,
pub diffuse_color_animation: M2AnimationBlock<M2Color>,
pub attenuation_start_animation: M2AnimationBlock<f32>,
pub attenuation_end_animation: M2AnimationBlock<f32>,
pub visibility_animation: M2AnimationBlock<f32>,
pub id: u32,
pub flags: M2LightFlags,
}Expand description
Represents a light in an M2 model
Fields§
§light_type: M2LightTypeLight type
bone_index: u16Bone to attach the light to
position: C3VectorLight position
ambient_color_animation: M2AnimationBlock<M2Color>Ambient color animation
diffuse_color_animation: M2AnimationBlock<M2Color>Diffuse color animation
attenuation_start_animation: M2AnimationBlock<f32>Attenuation start animation (where light begins to fade)
attenuation_end_animation: M2AnimationBlock<f32>Attenuation end animation (where light fully fades)
visibility_animation: M2AnimationBlock<f32>Visibility animation
id: u32Light ID
flags: M2LightFlagsLight flags
Implementations§
Source§impl M2Light
impl M2Light
Sourcepub fn parse<R: Read + Seek>(reader: &mut R, _version: u32) -> Result<Self>
pub fn parse<R: Read + Seek>(reader: &mut R, _version: u32) -> Result<Self>
Parse a light 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 light 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 light to a different version (no version differences for lights)
Sourcepub fn new(light_type: M2LightType, bone_index: u16, id: u32) -> Self
pub fn new(light_type: M2LightType, bone_index: u16, id: u32) -> Self
Create a new light with default values
Trait Implementations§
Auto Trait Implementations§
impl Freeze for M2Light
impl RefUnwindSafe for M2Light
impl Send for M2Light
impl Sync for M2Light
impl Unpin for M2Light
impl UnwindSafe for M2Light
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