pub struct AnimationSounds {
pub events: Vec<(String, Option<String>, f32)>,
pub fired: Vec<([f32; 3], String)>,
/* private fields */
}Expand description
The sound events the characters’ clips can fire, and the sounds that passed their draw.
Fields§
§events: Vec<(String, Option<String>, f32)>Each AnimAudioEvent the clips name: the event resource, its SoundEffect and its
probability.
fired: Vec<([f32; 3], String)>The sounds to play since the caller last took them: position and SoundEffect.
Implementations§
Source§impl AnimationSounds
impl AnimationSounds
Sourcepub fn learn(&mut self, templates: &[Template])
pub fn learn(&mut self, templates: &[Template])
Take in the sound events of templates loaded since the last call (the animals’ clips name theirs through their templates).
Sourcepub fn fire(
&mut self,
resources: &[String],
position: [f32; 3],
rng: &mut Random,
)
pub fn fire( &mut self, resources: &[String], position: [f32; 3], rng: &mut Random, )
For each event a character’s clip fired, in order: one RandFloat from the game’s
generator against the event’s probability; when it passes, its sound plays at the
character. An event that is not a sound draws nothing.
The draws come with each entity’s model update in the every-iteration phase, just before its character runs, as in the original.
Deviation: the original runs that phase entity by entity in its set’s order (by address, step 3 of issue #22). The port runs one kind at a time (citizens, animals, boats, nomads), each in its own order, and the trees’ draws come with the natural resources.
Original: FUN_14008d310, called through MeshInstance::Update from the
ModelComponent’s every-iteration update (FUN_140129e30).
Trait Implementations§
Source§impl Clone for AnimationSounds
impl Clone for AnimationSounds
Source§fn clone(&self) -> AnimationSounds
fn clone(&self) -> AnimationSounds
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more