Builtin Library
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) -> booleanchannel.sampleInto(ch, time, buf, offset) -> booleanchannel.sampleManyInto(ch, time, buf, offsets) -> booleanchannel.sampleVec3(ch, time) -> (x, y, z) | nilchannel.sampleQuat(ch, time) -> (x, y, z, w) | nil