@openhps/core
Version:
Open Hybrid Positioning System - Core component
49 lines (46 loc) • 1.64 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.QuaternionKeyframeTrack = void 0;
var _KeyframeTrack = require("../KeyframeTrack.js");
var _QuaternionLinearInterpolant = require("../../math/interpolants/QuaternionLinearInterpolant.js");
/**
* A track for Quaternion keyframe values.
*
* @augments KeyframeTrack
*/
class QuaternionKeyframeTrack extends _KeyframeTrack.KeyframeTrack {
/**
* Constructs a new Quaternion keyframe track.
*
* @param {string} name - The keyframe track's name.
* @param {Array<number>} times - A list of keyframe times.
* @param {Array<number>} values - A list of keyframe values.
* @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.
*/
constructor(name, times, values, interpolation) {
super(name, times, values, interpolation);
}
/**
* Overwritten so the method returns Quaternion based interpolant.
*
* @static
* @param {TypedArray} [result] - The result buffer.
* @return {QuaternionLinearInterpolant} The new interpolant.
*/
InterpolantFactoryMethodLinear(result) {
return new _QuaternionLinearInterpolant.QuaternionLinearInterpolant(this.times, this.values, this.getValueSize(), result);
}
}
/**
* The value type name.
*
* @type {String}
* @default 'quaternion'
*/
exports.QuaternionKeyframeTrack = QuaternionKeyframeTrack;
QuaternionKeyframeTrack.prototype.ValueTypeName = 'quaternion';
// ValueBufferType is inherited
// DefaultInterpolation is inherited;
QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined;