pub struct Formation {
pub positions: Vec<Vec3>,
pub chars: Vec<char>,
}Expand description
A formation: a list of 3D offsets from the entity center with per-slot characters.
Fields§
§positions: Vec<Vec3>§chars: Vec<char>Implementations§
Source§impl Formation
impl Formation
Sourcepub fn rings(spec: &[(usize, f32)]) -> Self
pub fn rings(spec: &[(usize, f32)]) -> Self
Concentric rings. Each entry is (glyph_count, radius).
Sourcepub fn diamond(size: i32) -> Self
pub fn diamond(size: i32) -> Self
Diamond shape (all integer (x,y) within Manhattan distance ≤ size).
Sourcepub fn cross(arm_length: i32) -> Self
pub fn cross(arm_length: i32) -> Self
Cross / plus sign with arm_length glyphs per arm (center + 4 arms).
Sourcepub fn star(points: usize, inner_r: f32, outer_r: f32) -> Self
pub fn star(points: usize, inner_r: f32, outer_r: f32) -> Self
N-pointed star with inner_r and outer_r radii.
Sourcepub fn hex_cluster(radius: f32) -> Self
pub fn hex_cluster(radius: f32) -> Self
Hexagonal close-pack: all hex centers within radius.
Sourcepub fn fibonacci_spiral(n: usize, scale: f32) -> Self
pub fn fibonacci_spiral(n: usize, scale: f32) -> Self
Fibonacci (golden-ratio) phyllotaxis spiral — N points.
Sourcepub fn dna_helix(height: f32, turns: f32, n: usize) -> Self
pub fn dna_helix(height: f32, turns: f32, n: usize) -> Self
Double helix (DNA-like): two interleaved spirals winding vertically.
Sourcepub fn lissajous(n: usize, a: f32, b: f32, delta: f32, scale: f32) -> Self
pub fn lissajous(n: usize, a: f32, b: f32, delta: f32, scale: f32) -> Self
Lissajous figure: parametric (sin(a·t+δ), sin(b·t)) for n points.
Sourcepub fn lorenz_trace(n: usize, scale: f32) -> Self
pub fn lorenz_trace(n: usize, scale: f32) -> Self
Lorenz attractor sample: step the attractor n times and record positions.
Sourcepub fn arrow(length: usize, direction: Vec3) -> Self
pub fn arrow(length: usize, direction: Vec3) -> Self
Arrow pointing in a direction (normalized), length glyphs long.
Sourcepub fn scatter(n: usize, radius: f32, seed: u64) -> Self
pub fn scatter(n: usize, radius: f32, seed: u64) -> Self
Random scatter within radius, seeded for reproducibility.
Sourcepub fn rune_sigma() -> Self
pub fn rune_sigma() -> Self
Rune: Sigma / S-curve.
Sourcepub fn rune_infinity() -> Self
pub fn rune_infinity() -> Self
Rune: Infinity / ∞ shape.
Sourcepub fn rune_chaos() -> Self
pub fn rune_chaos() -> Self
Rune: Chaos — a 3-armed triskelion.
Sourcepub fn sierpinski(depth: u32, size: f32) -> Self
pub fn sierpinski(depth: u32, size: f32) -> Self
Boss formation: Sierpinski triangle approximation (2 levels deep).
Sourcepub fn mandala(layers: usize, base_n: usize, base_r: f32) -> Self
pub fn mandala(layers: usize, base_n: usize, base_r: f32) -> Self
Boss formation: Mandala (multiple concentric rings with rotational symmetry).
Sourcepub fn rotated_z(self, angle: f32) -> Self
pub fn rotated_z(self, angle: f32) -> Self
Rotate the entire formation around the Z axis by angle radians.
Sourcepub fn translated(self, offset: Vec3) -> Self
pub fn translated(self, offset: Vec3) -> Self
Translate all positions by an offset.
Sourcepub fn mirrored_x(self) -> Self
pub fn mirrored_x(self) -> Self
Reflect across the Y axis (mirror left-right).
Sourcepub fn bounding_radius(&self) -> f32
pub fn bounding_radius(&self) -> f32
Compute bounding radius (max distance from centroid).
Sourcepub fn normalized(self) -> Self
pub fn normalized(self) -> Self
Normalize so bounding_radius == 1.0.