pub struct NodeMotion {Show 15 fields
pub forward: [f32; 3],
pub speed: Value,
pub speed_multiplier: Value,
pub acceleration: Value,
pub acceleration_multiplier: Value,
pub lift: Value,
pub lift_in_world: bool,
pub displacement: Option<Value>,
pub spin: [Value; 3],
pub spin_multiplier: [Value; 3],
pub align: bool,
pub turns: Option<Turns>,
pub drag: Option<Drag>,
pub min_speed: Option<f32>,
pub max_speed: Option<f32>,
}Expand description
How an emitter moves in its parent’s frame over its active time.
Fields§
§forward: [f32; 3]The direction of speed and acceleration in the emitter’s own frame (a unit vector).
speed: ValueSpeed along forward (metres per second) times its multiplier, and acceleration along it (metres per second squared)
times its multiplier, functions of the active time.
speed_multiplier: Value§acceleration: Value§acceleration_multiplier: Value§lift: ValueAcceleration along the emitter frame’s +Y (metres per second squared), or along the world’s +Y when lift_in_world.
lift_in_world: bool§displacement: Option<Value>A displacement of the emitter in its parent’s frame (metres), a function of the active time.
spin: [Value; 3]Spin about the emitter’s three axes (degrees per second) times a multiplier, functions of the active time.
spin_multiplier: [Value; 3]§align: boolWhether the emitter turns to face its motion: its forward along its velocity.
turns: Option<Turns>§drag: Option<Drag>§min_speed: Option<f32>The least and the most the speed along forward may be (metres per second): acceleration takes it no further,
and a speed that starts outside them is held to them. None for no limit.
max_speed: Option<f32>Implementations§
Source§impl NodeMotion
impl NodeMotion
Sourcepub fn advance(
&self,
state: &mut MotionState,
mover: Mover<'_>,
active: f32,
dt: f32,
placement: [f32; 4],
)
pub fn advance( &self, state: &mut MotionState, mover: Mover<'_>, active: f32, dt: f32, placement: [f32; 4], )
Moves mover’s state on by dt seconds, ending at the active time active (seconds), the values read at
active (random variation drawn in scope 0). placement is
the rotation of the emitter’s placement in its parent’s frame (a unit quaternion [x, y, z, w]): the forward and
a lift not in the world turn with it.
The speed along the forward is speed times its multiplier plus what acceleration times its multiplier has
added, held within min_speed and max_speed; lift adds speed along +Y (the world’s, or the placement’s).
The position moves by both, and a displacement, where there is one, replaces it. Spin turns the emitter about
its own axes (Y, then X, then Z), and each random turn, every interval seconds from the start, turns its
forward by up to max_angle about a random axis across it. An emitter that aligns with its motion faces its
forward along its velocity (facing); one at rest keeps the facing it had. Drag is how the particles follow the
emitter’s motion, not the motion itself, and is not stepped here.