Configure World State and Interpolation Parameters
masterThe World State must be an Array of non-nested Objects (except for Quaternions). You can specify how specific keys should be interpolated by appending suffixes to the parameter string in calcInterpolation.
Supported Suffixes:
(deg): For degrees(rad): For radians(quat): For quaternions
Examples:
Linear Interpolation:
If your state is [{ id: 'hero', x: 1, y: 2 }], use SI.calcInterpolation('x y').
Angular/Quaternion Interpolation:
If your state is [{ id: 'hero', direction: 1.5, rotationInDeg: 90, q: {x:0, y:0.7, z:0, w:0.7} }], use:
SI.calcInterpolation('direction(rad) rotationInDeg(deg) q(quat)').
Interpolating Nested States:
If your world state is a nested object (e.g., { players: [...], towers: [...] }), you can target a specific sub-state using the deep parameter:
SI.calcInterpolation('x y', 'players').
// Interpolating specific keys in a nested 'players' object
const snapshot = SI.calcInterpolation('x y', 'players')