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.