Skip to content

Commit

Permalink
Fix: Mouse-trail example is broken #78 (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberDex authored Mar 7, 2024
1 parent 00f7a5e commit 3cd5c54
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/examples/v7.0.0/advanced/mouseTrail.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,8 @@ function getTangent(k, factor, array)
return (factor * (clipInput(k + 1, array) - clipInput(k - 1, array))) / 2;
}

function cubicInterpolation(array, t, tangentFactor)
function cubicInterpolation(array, t, tangentFactor = 1)
{
if (tangentFactor === null) tangentFactor = 1;

const k = Math.floor(t);
const m = [getTangent(k, tangentFactor, array), getTangent(k + 1, tangentFactor, array)];
const p = [clipInput(k, array), clipInput(k + 1, array)];
Expand Down
6 changes: 2 additions & 4 deletions src/examples/v8.0.0/advanced/mouseTrail.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Assets, Point, Sprite, MeshRope } from 'pixi.js';
import { Application, Assets, Point, MeshRope } from 'pixi.js';

(async () =>
{
Expand Down Expand Up @@ -94,10 +94,8 @@ import { Application, Assets, Point, Sprite, MeshRope } from 'pixi.js';
return (factor * (clipInput(k + 1, array) - clipInput(k - 1, array))) / 2;
}

function cubicInterpolation(array, t, tangentFactor)
function cubicInterpolation(array, t, tangentFactor = 1)
{
if (tangentFactor === null) tangentFactor = 1;

const k = Math.floor(t);
const m = [getTangent(k, tangentFactor, array), getTangent(k + 1, tangentFactor, array)];
const p = [clipInput(k, array), clipInput(k + 1, array)];
Expand Down

0 comments on commit 3cd5c54

Please sign in to comment.