pub struct FieldSource {Show 14 fields
pub position: Vec3,
pub rest_offset: Vec3,
pub strength: f32,
pub radius: f32,
pub falloff: FalloffType,
pub color: Vec4,
pub emission: f32,
pub base_strength: f32,
pub breath_amplitude: f32,
pub breath_phase_offset: f32,
pub destroyed: bool,
pub damage_reduction: f32,
pub last_hit_time: f32,
pub tag: String,
}Expand description
A single field source (metaball) contributing to the entity’s scalar field.
Fields§
§position: Vec3Current world-space position of this source.
rest_offset: Vec3Base (rest) position, relative to entity center.
strength: f32Current field strength (modulated by HP, damage, breathing).
radius: f32Influence radius. Beyond this distance, contribution is zero (for Wyvill/Linear/SmoothPoly).
falloff: FalloffTypeHow the field decays with distance.
color: Vec4Color contribution for surface coloring.
emission: f32Emission intensity.
base_strength: f32Strength at full HP (before any modulation).
breath_amplitude: f32Breathing animation amplitude.
breath_phase_offset: f32Breathing animation phase offset (different sources breathe slightly out of sync).
destroyed: boolIf true, this source has been permanently destroyed by a crit.
damage_reduction: f32Temporary strength reduction from recent damage (decays over time).
last_hit_time: f32Time of last damage hit to this source.
tag: StringName/tag for this source (e.g. “head”, “torso_upper”, “left_arm”).
Implementations§
Source§impl FieldSource
impl FieldSource
pub fn new(offset: Vec3, strength: f32, radius: f32) -> Self
pub fn with_color(self, color: Vec4) -> Self
pub fn with_emission(self, e: f32) -> Self
pub fn with_falloff(self, f: FalloffType) -> Self
pub fn with_tag(self, tag: impl Into<String>) -> Self
pub fn with_breath(self, amplitude: f32, phase: f32) -> Self
Sourcepub fn effective_strength(&self, hp_ratio: f32) -> f32
pub fn effective_strength(&self, hp_ratio: f32) -> f32
Effective strength after HP modulation, damage reduction, and destruction.
Trait Implementations§
Source§impl Clone for FieldSource
impl Clone for FieldSource
Source§impl Debug for FieldSource
impl Debug for FieldSource
Auto Trait Implementations§
impl Freeze for FieldSource
impl RefUnwindSafe for FieldSource
impl Send for FieldSource
impl Sync for FieldSource
impl Unpin for FieldSource
impl UnsafeUnpin for FieldSource
impl UnwindSafe for FieldSource
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.