pub struct EmotionState { /* private fields */ }Expand description
A creature’s emotional state in valence/arousal space.
This drives vocalization selection, call intent, and continuous parameter modulation (vocal effort, breathiness, pitch scale).
Implementations§
Source§impl EmotionState
impl EmotionState
Sourcepub fn with_values(valence: f32, arousal: f32) -> Self
pub fn with_values(valence: f32, arousal: f32) -> Self
Creates an emotion state with specific initial values.
Sourcepub fn with_smoothing(self, smoothing: f32) -> Self
pub fn with_smoothing(self, smoothing: f32) -> Self
Sets the smoothing factor (0.0 = instant transitions, 0.95 = very sluggish).
Sourcepub fn update(&mut self, target_valence: f32, target_arousal: f32)
pub fn update(&mut self, target_valence: f32, target_arousal: f32)
Updates the emotional state toward a target, applying smoothing.
Call this once per frame or tick. The state exponentially decays
toward (target_valence, target_arousal) at a rate controlled
by smoothing.
Sourcepub fn set(&mut self, valence: f32, arousal: f32)
pub fn set(&mut self, valence: f32, arousal: f32)
Sets the emotional state directly (no smoothing).
Sourcepub fn evaluate(&self) -> EmotionOutput
pub fn evaluate(&self) -> EmotionOutput
Evaluates the current emotional state into synthesis parameters.
This is the core mapping from the 2D emotion space to concrete vocalization choices and parameter values.
Trait Implementations§
Source§impl Clone for EmotionState
impl Clone for EmotionState
Source§fn clone(&self) -> EmotionState
fn clone(&self) -> EmotionState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EmotionState
impl Debug for EmotionState
Source§impl Default for EmotionState
impl Default for EmotionState
Source§impl<'de> Deserialize<'de> for EmotionState
impl<'de> Deserialize<'de> for EmotionState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for EmotionState
impl RefUnwindSafe for EmotionState
impl Send for EmotionState
impl Sync for EmotionState
impl Unpin for EmotionState
impl UnsafeUnpin for EmotionState
impl UnwindSafe for EmotionState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more