pub struct ParticleController {Show 18 fields
pub position: [f32; 3],
pub previous_position: [f32; 3],
pub velocity: [f32; 3],
pub move_speed: f32,
pub sprint_multiplier: f32,
pub locomotion: ParticleLocomotion,
pub gravity: f32,
pub grounded: bool,
pub landing_timer: f32,
pub facing_yaw: f32,
pub cloud_radius: f32,
pub particle_count: u32,
pub base_color: [f32; 4],
pub movement_force_direction: [f32; 3],
pub movement_force_magnitude: f32,
pub rheology_blend: f32,
pub rheology_target: f32,
pub wave_formation: WaveFormationState,
}Expand description
Particle controller state — owns position, velocity, and locomotion. Updated per frame from input, drives the particle cloud shape.
Fields§
§position: [f32; 3]World-space center of the particle.
previous_position: [f32; 3]Previous frame position (GPU derives anchor velocity).
velocity: [f32; 3]Current velocity (m/s).
move_speed: f32Movement speed (m/s).
sprint_multiplier: f32Sprint speed multiplier.
locomotion: ParticleLocomotionCurrent locomotion state.
gravity: f32Gravity (m/s²).
grounded: boolWhether the particle is on the ground.
landing_timer: f32Time since last landing (seconds) — used for landing squash duration.
facing_yaw: f32Facing direction (yaw in radians, 0 = +Z).
cloud_radius: f32Cloud base radius (meters).
particle_count: u32Number of particles in the particle.
base_color: [f32; 4]Base particle color [r, g, b, a].
movement_force_direction: [f32; 3]Normalized world-space movement direction (from WASD+yaw).
movement_force_magnitude: f32Movement force magnitude: 0=idle, move_speed=walk, sprint=sprint.
rheology_blend: f32Current rheology blend (smooth interpolation toward target, 8/sec exponential).
rheology_target: f32Rheology target per locomotion state.
wave_formation: WaveFormationStateWave formation state — real wave math for particle positions.
Implementations§
Source§impl ParticleController
impl ParticleController
pub fn new(position: [f32; 3], particle_count: u32) -> Self
Sourcepub fn update(
&mut self,
forward: bool,
back: bool,
left: bool,
right: bool,
jump: bool,
sprint: bool,
camera_yaw: f32,
dt: f32,
) -> bool
pub fn update( &mut self, forward: bool, back: bool, left: bool, right: bool, jump: bool, sprint: bool, camera_yaw: f32, dt: f32, ) -> bool
Update the particle from WASD input relative to camera yaw. Returns true if the particle moved this frame.
Sourcepub fn wave_offsets(&self) -> &[[f32; 3]]
pub fn wave_offsets(&self) -> &[[f32; 3]]
Get wave formation particle offsets (relative to particle center). These are the real wave-equation-driven positions for GPU upload.
Sourcepub fn shape_params(&self) -> ParticleShapeParams
pub fn shape_params(&self) -> ParticleShapeParams
Get the current shape parameters for the particle cloud.