From 91d581a23ad27561c1359129f5d67e57c7a7f851 Mon Sep 17 00:00:00 2001 From: Dave Pagurek Date: Sat, 6 May 2023 13:10:22 -0400 Subject: [PATCH] Normalize adjusted normal and bump version --- package.json | 2 +- src/vecFunctions.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e9f6265..580c0c6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@davepagurek/glsl-autodiff", - "version": "0.0.17", + "version": "0.0.18", "main": "build/autodiff.js", "author": "Dave Pagurek ", "license": "MIT", diff --git a/src/vecFunctions.ts b/src/vecFunctions.ts index aa93f8a..30d9ce3 100644 --- a/src/vecFunctions.ts +++ b/src/vecFunctions.ts @@ -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(Base: T) {