pub struct EmotionExpression {
pub emotion: Emotion,
pub intensity: f32,
pub weights: HashMap<String, f32>,
}Expand description
A morph weight map for one emotion at a given intensity.
Fields§
§emotion: EmotionThe emotion this expression represents.
intensity: f32Global intensity scalar (0..=1).
weights: HashMap<String, f32>Morph target name → base weight (before intensity scaling).
Implementations§
Source§impl EmotionExpression
impl EmotionExpression
Sourcepub fn new(emotion: Emotion) -> Self
pub fn new(emotion: Emotion) -> Self
Create a new expression with intensity 1.0 and no morph weights.
Sourcepub fn with_weight(self, morph: impl Into<String>, weight: f32) -> Self
pub fn with_weight(self, morph: impl Into<String>, weight: f32) -> Self
Builder: add or replace a morph target weight.
Sourcepub fn with_intensity(self, intensity: f32) -> Self
pub fn with_intensity(self, intensity: f32) -> Self
Builder: set global intensity.
Sourcepub fn effective_weights(&self) -> HashMap<String, f32>
pub fn effective_weights(&self) -> HashMap<String, f32>
Return the effective weights: each base weight multiplied by intensity.
Auto Trait Implementations§
impl Freeze for EmotionExpression
impl RefUnwindSafe for EmotionExpression
impl Send for EmotionExpression
impl Sync for EmotionExpression
impl Unpin for EmotionExpression
impl UnsafeUnpin for EmotionExpression
impl UnwindSafe for EmotionExpression
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more