Skip to main content

Modifier

Trait Modifier 

Source
pub trait Modifier: Send + Sync {
    // Required methods
    fn class_index(&self) -> u16;
    fn num_targets(&self) -> usize;
    fn add_target(&mut self, target: Uoid);
    fn remove_target(&mut self, target: &Uoid);
    fn eval(&mut self, secs: f64, del: f32, dirty: u32) -> bool;
}
Expand description

Trait for all modifiers — objects that attach to scene objects and respond to messages and per-frame updates.

Corresponds to plModifier in C++.

Required Methods§

Source

fn class_index(&self) -> u16

Get the class index of this modifier.

Source

fn num_targets(&self) -> usize

Get the number of targets this modifier is attached to.

Source

fn add_target(&mut self, target: Uoid)

Add a target scene object.

Source

fn remove_target(&mut self, target: &Uoid)

Remove a target scene object.

Source

fn eval(&mut self, secs: f64, del: f32, dirty: u32) -> bool

Per-frame evaluation. Called each frame for active modifiers. Returns true if the modifier’s state changed.

Implementors§