Skip to documentation
SLOP

tiny.rig.Playback

Reference tiny.rig Playback

Defined in tiny.rig.

API (7)

Actions

Public operations.

Fields and members

Public fields and members.

No direct callersNo direct callstiny.rigPlayback
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: fun/rig/src/playback.zig:23

zig
pub const Playback = struct {    /// Seconds into the clip.    time: f64 = 0,    speed: f32 = 1,    loop: bool = true,    /// Poses shown a second, or null for a new pose at every sample.    step_rate: ?f32 = null,    pub fn advance(playback: *Playback, seconds: f64) void {        assert(std.math.isFinite(seconds));        assert(std.math.isFinite(playback.speed));        playback.time += seconds * playback.speed;    }    /// The index of the pose on show, when stepping. A playhead within    /// `time.boundary_tolerance` of a step boundary counts as on it, so a    /// clock advanced by a rounded 1/60 each tick still turns poses on    /// exact ticks.    pub fn step(playback: Playback) ?i64 {        const rate = playback.step_rate orelse return null;        assert(std.math.isFinite(rate));        assert(rate > 0);        const position = time.floorSnapped(playback.time * rate);        assert(@abs(position) < max_exact_step);        return @intFromFloat(position);    }    /// The time to sample the clip at: the playhead, or the start of its    /// step.    pub fn sampleTime(playback: Playback) f64 {        const index = playback.step() orelse return playback.time;        return @as(f64, @floatFromInt(index)) / playback.step_rate.?;    }};

Source: fun/rig/src/root.zig:43

zig
pub const Playback = playback.Playback;
Called byCallsNo direct callersprivate; no linkfun.rig.src.timefloorSnappedPlaybackstep
Static calls · unresolved targets: 0 · external targets: 0.

Audit

Definitions4
Public names4
Members4
Version26.7.0
Revisiondaab053ee433