Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions src/animation/AnimationAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@ class AnimationAction {

const interpolant = tracks[ i ].createInterpolant( null );
interpolants[ i ] = interpolant;

// preserve interpolant settings (like tangent data from BezierInterpolant)

if ( interpolant.settings ) {

Object.assign( interpolantSettings, interpolant.settings );

}

interpolant.settings = interpolantSettings;

}
Expand Down
4 changes: 2 additions & 2 deletions src/animation/KeyframeTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ class KeyframeTrack {

const interpolant = new BezierInterpolant( this.times, this.values, this.getValueSize(), result );

// Pass tangent data from track settings to interpolant
if ( this.settings ) {

interpolant.settings = this.settings;
interpolant.inTangents = this.settings.inTangents;
interpolant.outTangents = this.settings.outTangents;

}

Expand Down
10 changes: 4 additions & 6 deletions src/math/interpolants/BezierInterpolant.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import { Interpolant } from '../Interpolant.js';
* each keyframe has explicit in/out tangent control points specified as
* 2D coordinates (time, value).
*
* The tangent data must be provided via the `settings` object:
* - `settings.inTangents`: Float32Array with [time, value] pairs per keyframe per component
* - `settings.outTangents`: Float32Array with [time, value] pairs per keyframe per component
* Tangent data is read from `inTangents` and `outTangents` on the interpolant
* (populated by `KeyframeTrack.InterpolantFactoryMethodBezier`).
*
* For a track with N keyframes and stride S:
* - Each tangent array has N * S * 2 values
Expand All @@ -29,9 +28,8 @@ class BezierInterpolant extends Interpolant {
const offset1 = i1 * stride;
const offset0 = offset1 - stride;

const settings = this.settings || this.DefaultSettings_;
const inTangents = settings.inTangents;
const outTangents = settings.outTangents;
const inTangents = this.inTangents;
const outTangents = this.outTangents;

// If no tangent data, fall back to linear interpolation
if ( ! inTangents || ! outTangents ) {
Expand Down