pub struct WeaponPhysicsSystem {
pub trail: WeaponTrail,
pub impacts: Vec<ImpactEffect>,
pub damage_numbers: DamageNumberManager,
pub combo_integration: ComboTrailIntegration,
pub milestone_effects: Vec<ComboMilestoneEffect>,
pub block_effects: Vec<BlockEffect>,
pub parry_effect: Option<ParryEffect>,
pub time_scale: f32,
}Expand description
Top-level system that ties together weapon trails, impact effects, damage numbers, and combo integration.
Fields§
§trail: WeaponTrailThe active weapon trail.
impacts: Vec<ImpactEffect>Active impact effects.
damage_numbers: DamageNumberManagerDamage number manager (pooled).
combo_integration: ComboTrailIntegrationCombo trail integration.
milestone_effects: Vec<ComboMilestoneEffect>Active combo milestone effects.
block_effects: Vec<BlockEffect>Active block effects.
parry_effect: Option<ParryEffect>Active parry effect (at most one at a time).
time_scale: f32Global time scale (affected by parry slow-mo).
Implementations§
Source§impl WeaponPhysicsSystem
impl WeaponPhysicsSystem
Sourcepub fn new(weapon_type: WeaponType) -> Self
pub fn new(weapon_type: WeaponType) -> Self
Create a new system for the given weapon type.
Sourcepub fn switch_weapon(&mut self, weapon_type: WeaponType)
pub fn switch_weapon(&mut self, weapon_type: WeaponType)
Switch to a different weapon type, resetting the trail.
Sourcepub fn begin_swing(&mut self, arc: SwingArc)
pub fn begin_swing(&mut self, arc: SwingArc)
Begin a swing with the given arc parameters.
Sourcepub fn on_hit(
&mut self,
contact_point: Vec3,
velocity_magnitude: f32,
damage: i32,
crit: bool,
screen_pos: Vec2,
hit_direction: Vec3,
)
pub fn on_hit( &mut self, contact_point: Vec3, velocity_magnitude: f32, damage: i32, crit: bool, screen_pos: Vec2, hit_direction: Vec3, )
Handle a weapon hitting an entity.
Sourcepub fn on_block(
&mut self,
contact_point: Vec3,
attacker_direction: Vec3,
velocity_magnitude: f32,
)
pub fn on_block( &mut self, contact_point: Vec3, attacker_direction: Vec3, velocity_magnitude: f32, )
Handle an attack being blocked.
Sourcepub fn update_combo(&mut self, combo_count: u32)
pub fn update_combo(&mut self, combo_count: u32)
Update the combo count (from the combo tracker).
Sourcepub fn trail_vertices(&self) -> Vec<TrailVertex>
pub fn trail_vertices(&self) -> Vec<TrailVertex>
Get trail render data for the GPU.
Trait Implementations§
Source§impl Clone for WeaponPhysicsSystem
impl Clone for WeaponPhysicsSystem
Source§fn clone(&self) -> WeaponPhysicsSystem
fn clone(&self) -> WeaponPhysicsSystem
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 WeaponPhysicsSystem
impl RefUnwindSafe for WeaponPhysicsSystem
impl Send for WeaponPhysicsSystem
impl Sync for WeaponPhysicsSystem
impl Unpin for WeaponPhysicsSystem
impl UnsafeUnpin for WeaponPhysicsSystem
impl UnwindSafe for WeaponPhysicsSystem
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.