Newer
Older
HuangJiPC / public / static / three / src / math / interpolants / DiscreteInterpolant.js
@zhangdeliang zhangdeliang on 21 Jun 482 bytes update
import { Interpolant } from '../Interpolant.js';

/**
 *
 * Interpolant that evaluates to the sample value at the position preceding
 * the parameter.
 */

class DiscreteInterpolant extends Interpolant {

	constructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {

		super( parameterPositions, sampleValues, sampleSize, resultBuffer );

	}

	interpolate_( i1 /*, t0, t, t1 */ ) {

		return this.copySampleValue_( i1 - 1 );

	}

}


export { DiscreteInterpolant };