Skip to content

struct

Motion

pub struct Motion {
    pub spin: Vec3,
    pub float: f32,
    pub pulse: f32,
    pub speed: f32,
}

Continuous animation applied on top of an object's transform.

Fields

spin

pub spin: Vec3

Rotation speed in degrees per second, per axis.

float

pub float: f32

Vertical bobbing amplitude (world units).

pulse

pub pulse: f32

Scale pulsing amplitude (fraction of the scale).

speed

pub speed: f32

Frequency multiplier (Hz) for float and pulse.

Methods

is_static

pub fn is_static(&self) -> bool

Whether it doesn't move at all: no spin, float or pulse.

apply

pub fn apply(&self, base: &Transform, t: f32) -> Transform

The transform at time t (seconds).

Trait implementations