From cc019fab5015cca1f3ea9f648b03d3a0ab5620e2 Mon Sep 17 00:00:00 2001 From: Micheal Parks Date: Wed, 17 Jul 2024 17:06:37 -0400 Subject: [PATCH] fix invalid setter --- package.json | 2 +- src/orientation-vector.ts | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 65438d4..a92818e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@viamrobotics/three", - "version": "0.0.9", + "version": "0.0.10", "license": "Apache-2.0", "type": "module", "files": [ diff --git a/src/orientation-vector.ts b/src/orientation-vector.ts index fa2301c..6d4fb58 100644 --- a/src/orientation-vector.ts +++ b/src/orientation-vector.ts @@ -102,7 +102,7 @@ export class OrientationVector { } set z(value: number) { - this.#vec.setY(value); + this.#vec.setZ(value); if (this.autoNormalize) { this.#vec.normalize(); @@ -221,7 +221,7 @@ export class OrientationVector { return this.toArray(); } - setFromQuaternion(quaternion: Quaternion, update = true): this { + setFromQuaternion(quaternion: Quaternion): this { // Get the transform of our +X and +Z points const conj = quatA.copy(quaternion).conjugate(); const newX = quatB.multiplyQuaternions(quaternion, xAxis).multiply(conj); @@ -280,9 +280,7 @@ export class OrientationVector { this.set(newZ.x, newZ.y, newZ.z, th); - if (update) { - this.#onChangeCallback?.(); - } + this.#onChangeCallback?.(); return this; }