pub struct DreamWaveController {
pub particle: ParticleController,
pub decoherence: DecoherenceState,
pub quantum: QuantumLocomotionState,
pub bone_targets: Vec<[f32; 3]>,
pub particle_weights: Vec<f32>,
/* private fields */
}Expand description
DreamWaveController — the observer’s wave form representation. Wraps ParticleController with zone-driven decoherence transitions.
The controller exists in one of two regimes:
- Coherent: ParticleController drives position and shape (cheap, procedural)
- Decohering/Collapsed: Target form’s bone positions blend with particle positions
The transition between regimes uses the Lindblad decoherence kernel: coherence(t) = exp(-Gamma * t)
Per-particle position during transition: pos = lerp(particle_offset, bone_target, 1.0 - coherence)
Fields§
§particle: ParticleControllerThe underlying particle controller (always exists, drives position/velocity).
decoherence: DecoherenceStateCurrent decoherence state.
quantum: QuantumLocomotionStateQuantum locomotion density matrix state.
bone_targets: Vec<[f32; 3]>Per-particle target positions (bone positions for humanoid, hull points for vehicle). Pre-allocated, reused every frame (Clean Compute).
particle_weights: Vec<f32>Per-particle coherence weight (for GPU upload). 1.0 = at particle position, 0.0 = at bone target.
Implementations§
Source§impl DreamWaveController
impl DreamWaveController
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,
fields: &[DecoherenceField],
) -> bool
pub fn update( &mut self, forward: bool, back: bool, left: bool, right: bool, jump: bool, sprint: bool, camera_yaw: f32, dt: f32, fields: &[DecoherenceField], ) -> bool
Update the wave controller from input + zone decoherence fields. Returns true if the observer moved this frame.
Sourcepub fn coherence(&self) -> f32
pub fn coherence(&self) -> f32
Current coherence level (1.0 = fully particle, 0.0 = fully collapsed).
Sourcepub fn current_form(&self) -> WaveForm
pub fn current_form(&self) -> WaveForm
Current wave form.
Sourcepub fn is_decohering(&self) -> bool
pub fn is_decohering(&self) -> bool
Whether the observer is actively decohering.
Sourcepub fn is_collapsed(&self) -> bool
pub fn is_collapsed(&self) -> bool
Whether the observer is fully collapsed into a target form.
Sourcepub fn is_recohering(&self) -> bool
pub fn is_recohering(&self) -> bool
Whether the observer is re-cohering back to particle.
Sourcepub fn set_bone_targets(&mut self, bones: &[[f32; 3]])
pub fn set_bone_targets(&mut self, bones: &[[f32; 3]])
Set bone target positions for the current target form. Called when FBX skeleton is evaluated.