pub struct WeaponTrail {
pub profile: WeaponProfile,
/* private fields */
}Expand description
Manages a ring buffer of trail segments, spawning them along a swing arc and applying impact compression.
Fields§
§profile: WeaponProfileThe weapon profile driving trail appearance.
Implementations§
Source§impl WeaponTrail
impl WeaponTrail
Sourcepub fn new(profile: WeaponProfile) -> Self
pub fn new(profile: WeaponProfile) -> Self
Create a new trail for the given weapon profile.
Sourcepub fn set_combo_intensity(&mut self, intensity: f32)
pub fn set_combo_intensity(&mut self, intensity: f32)
Set the combo intensity multiplier. Higher values make the trail wider, brighter, and more emissive.
Sourcepub fn begin_swing(&mut self, arc: SwingArc)
pub fn begin_swing(&mut self, arc: SwingArc)
Begin a new swing, replacing any active arc.
Sourcepub fn on_impact(&mut self, contact_point: Vec3)
pub fn on_impact(&mut self, contact_point: Vec3)
Trigger the impact compression effect at the given contact point.
Segments near the contact will compress toward it, then spring back
after IMPACT_COMPRESS_DURATION seconds.
Sourcepub fn get_render_data(&self) -> Vec<TrailVertex>
pub fn get_render_data(&self) -> Vec<TrailVertex>
Build triangle-strip render data from the current trail segments.
Trait Implementations§
Source§impl Clone for WeaponTrail
impl Clone for WeaponTrail
Source§fn clone(&self) -> WeaponTrail
fn clone(&self) -> WeaponTrail
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 WeaponTrail
impl RefUnwindSafe for WeaponTrail
impl Send for WeaponTrail
impl Sync for WeaponTrail
impl Unpin for WeaponTrail
impl UnsafeUnpin for WeaponTrail
impl UnwindSafe for WeaponTrail
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.