Skip to main content

WaveFormationState

Struct WaveFormationState 

Source
pub struct WaveFormationState {
    pub phase_time: f32,
    pub idle_time: f32,
    pub fibonacci_blend: f32,
    pub amplitude: f32,
    pub frequency: f32,
    pub wavelength: f32,
    pub heading: [f32; 2],
    pub offsets: Vec<[f32; 3]>,
}
Expand description

Per-particle wave formation state. Pre-allocated, updated every frame. Drives the visual shape of the particle using real wave equation math.

Fields§

§phase_time: f32

Cumulative phase time (seconds). Drives ω·t in the wave equation.

§idle_time: f32

Time spent in current idle (seconds). Drives idle→Fibonacci decoherence.

§fibonacci_blend: f32

Blend from wave(0.0) to Fibonacci(1.0). Uses exp(-Γ·t_idle).

§amplitude: f32

Wave amplitude A. Scales with velocity for weighty feel.

§frequency: f32

Wave frequency f (Hz). Higher = faster ripple.

§wavelength: f32

Wavelength λ. Controls spatial density of ripples.

§heading: [f32; 2]

Heading direction [x, z] normalized. Wave propagates along this axis.

§offsets: Vec<[f32; 3]>

Pre-computed particle offsets for current frame. Reused by GPU upload.

Implementations§

Source§

impl WaveFormationState

Source

pub fn new(particle_count: u32) -> Self

Source

pub fn update( &mut self, speed: f32, heading: [f32; 2], yaw: f32, dt: f32, particle_count: u32, radius: f32, )

Update wave formation from controller state. speed: current movement speed (0 = idle). heading: normalized [x, z] movement direction. dt: frame delta time.

Trait Implementations§

Source§

impl Clone for WaveFormationState

Source§

fn clone(&self) -> WaveFormationState

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.