Skip to content

Commit

Permalink
Normalize adjusted normal and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
davepagurek committed May 6, 2023
1 parent c959831 commit 91d581a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@davepagurek/glsl-autodiff",
"version": "0.0.17",
"version": "0.0.18",
"main": "build/autodiff.js",
"author": "Dave Pagurek <[email protected]>",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions src/vecFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,11 @@ VectorOp.prototype.adjustNormal = function(normal: VecParam, position: VecParam)
const jacobian = new OffsetJacobian(this.ad, position, this)
const dodu = new VecMult(this.ad, jacobian, u)
const dodv = new VecMult(this.ad, jacobian, v)
return new Cross(
return new VecNormalize(this.ad, new Cross(
this.ad,
new VecSum(this.ad, u, dodu),
new VecSum(this.ad, v, dodv),
)
))
}

export function WithVecFunctions<T extends ADConstructor>(Base: T) {
Expand Down

0 comments on commit 91d581a

Please sign in to comment.