Skip to main content

DreamWaveController

Struct DreamWaveController 

Source
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:

  1. Coherent: ParticleController drives position and shape (cheap, procedural)
  2. 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: ParticleController

The underlying particle controller (always exists, drives position/velocity).

§decoherence: DecoherenceState

Current decoherence state.

§quantum: QuantumLocomotionState

Quantum 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

Source

pub fn new(position: [f32; 3], particle_count: u32) -> Self

Source

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.

Source

pub fn coherence(&self) -> f32

Current coherence level (1.0 = fully particle, 0.0 = fully collapsed).

Source

pub fn current_form(&self) -> WaveForm

Current wave form.

Source

pub fn is_decohering(&self) -> bool

Whether the observer is actively decohering.

Source

pub fn is_collapsed(&self) -> bool

Whether the observer is fully collapsed into a target form.

Source

pub fn is_recohering(&self) -> bool

Whether the observer is re-cohering back to particle.

Source

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.

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> 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, 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.