Skip to content

Commit

Permalink
ベクトル計算修正
Browse files Browse the repository at this point in the history
  • Loading branch information
sho1374k committed Aug 20, 2023
1 parent ac7ced5 commit 55997c0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/assets/js/webgl/ObjectPlane.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,12 @@ export class ObjectPlane extends Object {
const y = v.y.current;

// subtracts vector
this.curve.x.current = x - this.curve.x.target;
this.curve.y.current = y - this.curve.y.target;
this.curve.x.current = this.curve.x.target - x;
this.curve.y.current = this.curve.y.target - y;

// multiply scalar
this.curve.x.current *= this.curve.power * -1;
this.curve.y.current *= this.curve.power * -1;
this.curve.x.current *= this.curve.power;
this.curve.y.current *= this.curve.power;

this.updateUniform("uCurve", "v2", [this.curve.x.current, this.curve.y.current]);
};
Expand Down

0 comments on commit 55997c0

Please sign in to comment.