pub struct DebrisParticle {Show 19 fields
pub glyph: char,
pub position: Vec3,
pub velocity: Vec3,
pub angular_velocity: Vec3,
pub mass: f32,
pub restitution: f32,
pub friction: f32,
pub lifetime: f32,
pub max_lifetime: f32,
pub color: [f32; 4],
pub scale: f32,
pub rotation: Quat,
pub debris_type: DebrisType,
pub alive: bool,
pub has_shattered: bool,
pub emission: f32,
pub glow_color: Vec3,
pub settled: bool,
pub fade_time: f32,
}Expand description
A single piece of combat debris — a glyph char with rigid-body dynamics.
Fields§
§glyph: charThe glyph character this debris displays.
position: Vec3World position.
velocity: Vec3Linear velocity (m/s).
angular_velocity: Vec3Angular velocity (rad/s) around each axis.
mass: f32Mass (kg). Affects inter-particle collision response.
restitution: f32Coefficient of restitution [0, 1]. 0 = perfectly inelastic, 1 = elastic.
friction: f32Surface friction coefficient [0, 1].
lifetime: f32Time this particle has been alive (seconds).
max_lifetime: f32Maximum time before the particle begins settling/fading.
color: [f32; 4]RGBA colour.
scale: f32Uniform scale factor.
rotation: QuatCurrent rotation (Euler-ish, stored as quaternion for blending).
debris_type: DebrisTypeThe elemental type driving behaviour.
alive: boolWhether this particle is alive and should be simulated/rendered.
has_shattered: boolWhether this particle has already shattered (Ice only — prevents infinite recursion).
emission: f32Emission intensity (glow).
glow_color: Vec3Glow colour (RGB).
settled: boolTrue when the particle is on the ground and mostly at rest.
fade_time: f32Time spent in the settled/fading state.
Implementations§
Source§impl DebrisParticle
impl DebrisParticle
Sourcepub fn new(glyph: char, debris_type: DebrisType) -> Self
pub fn new(glyph: char, debris_type: DebrisType) -> Self
Create a new debris particle with the given character and type.
Sourcepub fn effective_alpha(&self) -> f32
pub fn effective_alpha(&self) -> f32
Returns the alpha after applying fade.
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
True when the particle has finished fading and can be recycled.
Trait Implementations§
Source§impl Clone for DebrisParticle
impl Clone for DebrisParticle
Source§fn clone(&self) -> DebrisParticle
fn clone(&self) -> DebrisParticle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DebrisParticle
impl Debug for DebrisParticle
Auto Trait Implementations§
impl Freeze for DebrisParticle
impl RefUnwindSafe for DebrisParticle
impl Send for DebrisParticle
impl Sync for DebrisParticle
impl Unpin for DebrisParticle
impl UnsafeUnpin for DebrisParticle
impl UnwindSafe for DebrisParticle
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
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.