(f0, f1, weight)
| 317 | |
| 318 | // interpolates f1 into f0 |
| 319 | interpolate_frame(f0, f1, weight) { |
| 320 | if (weight > 1) { |
| 321 | weight = 1; |
| 322 | } else if (weight < 0) { |
| 323 | weight = 0; |
| 324 | } |
| 325 | let f = new Float32Array(5); |
| 326 | f[0] = weight * f0[0] + (1 - weight) * f1[0]; |
| 327 | f[1] = weight * f0[1] + (1 - weight) * f1[1]; |
| 328 | f[2] = weight * f0[2] + (1 - weight) * f1[2]; |
| 329 | f[3] = weight * f0[3] + (1 - weight) * f1[3]; |
| 330 | return f; |
| 331 | } |
| 332 | |
| 333 | // set index, k (of x, y, scale, rot) to val |
| 334 | interpolate(index) { |
no outgoing calls
no test coverage detected