Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit3bb1da2647

README.md

channel Module

Public Luau surface over the __channel Internal FFI namespace — keyframe-channel sampling primitives.

Purpose

Wrap the raw __channel.* FFI namespace in a typed Luau table that gets auto-injected as _G.channel via the prelude. Channels are the keyframe-track substrate: one per animation curve (translation x, rotation, blend weight, …). Sampling writes the interpolated value(s) into a buffer at a specified offset — no per-sample allocation, no per-bone FFI round-trip.

Usage

local h = channel.create({
    times    = { 0.0, 0.5, 1.0 },
    values   = { 0, 1, 0, 1, 1, 0, 0, 0, 1 },
    stride   = 3,
    interp   = "linear",
})

channel.sampleInto(h, 0.25, buf, 0)
channel.sampleManyInto(h, 0.25, buf, { 0, 9, 18 })
local x, y, z = channel.sampleVec3(h, 0.25)
channel.destroy(h)

Exports

  • channel.create(opts) -> number?
  • channel.destroy(handle) -> boolean
  • channel.sampleInto(ch, time, buf, offset) -> boolean
  • channel.sampleManyInto(ch, time, buf, offsets) -> boolean
  • channel.sampleVec3(ch, time) -> (x, y, z) | nil
  • channel.sampleQuat(ch, time) -> (x, y, z, w) | nil