Revision bdb341bc
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/library/type/Dynamic1D.java | ||
---|---|---|
375 | 375 |
} |
376 | 376 |
|
377 | 377 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
378 |
/** |
|
379 |
* Writes the results of interpolation between the Points at time 'time' to the passed float buffer. |
|
380 |
* <p> |
|
381 |
* Since this is a 1-dimensional Dynamic, the resulting interpolated Static1D gets written |
|
382 |
* to a single location in the buffer: buffer[offset]. |
|
383 |
* |
|
384 |
* @param buffer Float buffer we will write the resulting Static1D to. |
|
385 |
* @param offset Offset in the buffer where to write the result. |
|
386 |
* @param time Time of interpolation. Time=0.0 would return the first Point, Time=0.5 - the last, |
|
387 |
* time=1.0 - the first again, and time 0.1 would be 1/5 of the way between the first and the last Points. |
|
388 |
*/ |
|
378 |
|
|
389 | 379 |
synchronized void interpolate(float[] buffer, int offset, float time) |
390 | 380 |
{ |
391 | 381 |
switch(numPoints) |
Also available in: Unified diff
Dynamics: Introduce 2 Modes of operation:
- 'random access' mode, where we are able to call a single Dynamic from multiple thread simultaneously.
- 'sequential' mode, which only permits sequential interpolation from one client.
The second mode has an advantage when one needs to change mDuration: it keeps on interpolating smoothly. In the first mode, this is not possible.