pub struct FieldVisualizer {
pub config: FieldVizConfig,
pub center: Vec2,
pub active: bool,
pub boss_overlays: Vec<BossFieldOverlay>,
pub last_sample_us: u32,
/* private fields */
}Expand description
Force field visualization system.
Maintains a grid of sample points, periodically re-samples the force field, and updates glyph positions/colors/characters to show the field state.
Fields§
§config: FieldVizConfigVisualization configuration.
center: Vec2Center of the visualization grid in world space.
active: boolWhether the visualizer is currently active.
boss_overlays: Vec<BossFieldOverlay>Active boss-specific overlays.
last_sample_us: u32Performance: last sample time in microseconds.
Implementations§
Source§impl FieldVisualizer
impl FieldVisualizer
Sourcepub fn new(center: Vec2, config: FieldVizConfig) -> Self
pub fn new(center: Vec2, config: FieldVizConfig) -> Self
Create a new field visualizer centered at center.
Sourcepub fn set_center(&mut self, center: Vec2)
pub fn set_center(&mut self, center: Vec2)
Re-center the visualization grid.
Sourcepub fn tick(&mut self, dt: f32, field_mgr: &FieldManager, time: f32)
pub fn tick(&mut self, dt: f32, field_mgr: &FieldManager, time: f32)
Sample the force fields and update the grid.
field_mgr provides the combined field evaluation.
time is the current scene time.
Sourcepub fn update_glyphs(&mut self, pool: &mut GlyphPool)
pub fn update_glyphs(&mut self, pool: &mut GlyphPool)
Spawn/update visualization glyphs in the glyph pool.
Call after tick(). Creates or updates glyphs for each sample point
that exceeds the strength threshold.
Sourcepub fn despawn_all(&mut self, pool: &mut GlyphPool)
pub fn despawn_all(&mut self, pool: &mut GlyphPool)
Despawn all visualization glyphs.
Sourcepub fn add_shockwave(
&mut self,
center: Vec2,
speed: f32,
max_radius: f32,
strength: f32,
)
pub fn add_shockwave( &mut self, center: Vec2, speed: f32, max_radius: f32, strength: f32, )
Add an expanding shockwave ring.
Sourcepub fn add_gravity_well(&mut self, center: Vec2, radius: f32, ring_count: u32)
pub fn add_gravity_well(&mut self, center: Vec2, radius: f32, ring_count: u32)
Add a gravity well visualization (concentric inward rings).
Sourcepub fn clear_gravity_wells(&mut self)
pub fn clear_gravity_wells(&mut self)
Remove all gravity wells.
Sourcepub fn add_boss_overlay(&mut self, overlay: BossFieldOverlay)
pub fn add_boss_overlay(&mut self, overlay: BossFieldOverlay)
Add a boss-specific overlay.
Sourcepub fn clear_boss_overlays(&mut self)
pub fn clear_boss_overlays(&mut self)
Remove all boss overlays.
Sourcepub fn visible_count(&self) -> usize
pub fn visible_count(&self) -> usize
Get the total number of visible arrow glyphs.
Sourcepub fn avg_strength(&self) -> f32
pub fn avg_strength(&self) -> f32
Get average field strength across the grid.
Sourcepub fn max_strength(&self) -> f32
pub fn max_strength(&self) -> f32
Get maximum field strength on the grid.
Source§impl FieldVisualizer
impl FieldVisualizer
Sourcepub fn snapshot(&self) -> FieldSnapshot
pub fn snapshot(&self) -> FieldSnapshot
Take a snapshot of the current grid state.
Auto Trait Implementations§
impl Freeze for FieldVisualizer
impl RefUnwindSafe for FieldVisualizer
impl Send for FieldVisualizer
impl Sync for FieldVisualizer
impl Unpin for FieldVisualizer
impl UnsafeUnpin for FieldVisualizer
impl UnwindSafe for FieldVisualizer
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> 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.