Buckets:
ktongue/docker_container / simsite /frontend /node_modules /three /src /math /interpolants /QuaternionLinearInterpolant.js
| import { Interpolant } from '../Interpolant.js'; | |
| import { Quaternion } from '../Quaternion.js'; | |
| /** | |
| * Spherical linear unit quaternion interpolant. | |
| */ | |
| class QuaternionLinearInterpolant extends Interpolant { | |
| constructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) { | |
| super( parameterPositions, sampleValues, sampleSize, resultBuffer ); | |
| } | |
| interpolate_( i1, t0, t, t1 ) { | |
| const result = this.resultBuffer, | |
| values = this.sampleValues, | |
| stride = this.valueSize, | |
| alpha = ( t - t0 ) / ( t1 - t0 ); | |
| let offset = i1 * stride; | |
| for ( let end = offset + stride; offset !== end; offset += 4 ) { | |
| Quaternion.slerpFlat( result, 0, values, offset - stride, values, offset, alpha ); | |
| } | |
| return result; | |
| } | |
| } | |
| export { QuaternionLinearInterpolant }; | |
Xet Storage Details
- Size:
- 789 Bytes
- Xet hash:
- da5c719c1d0438d721ec33ba3d65b28cb32cb75d85bba5549ff19a68a7927d5d
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.