From fc56f270799783592fb5ee4ba266884f790fac4e Mon Sep 17 00:00:00 2001 From: cailean Date: Fri, 28 Nov 2025 00:05:25 +0000 Subject: [PATCH] sprite --- js/Content.js | 4 ++-- js/Item.js | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/js/Content.js b/js/Content.js index ea934a9..83b14a4 100644 --- a/js/Content.js +++ b/js/Content.js @@ -175,8 +175,8 @@ export class ImageContent extends Content { (texture) => { this.texture = texture; const aspect = texture.image.width / texture.image.height; - const maxWidth = 4.5; - const height = 4; + const maxWidth = 4; + const height = 3; let width = height * aspect; if (width > maxWidth) { width = maxWidth; diff --git a/js/Item.js b/js/Item.js index 0452ce4..4cbd6ae 100644 --- a/js/Item.js +++ b/js/Item.js @@ -432,16 +432,13 @@ export class Item { boundingBox.getBoundingSphere(boundingSphere); // Set the desired world scale for the indicator based on the object's size - const desiredScale = boundingSphere.radius * 2.5; + const desiredScale = boundingSphere.radius * 0.2; this.hoverIndicator.scale.set(desiredScale, desiredScale, desiredScale); // Counteract the parent's scale by dividing the indicator's scale by the parent's scale. - if (scale.x !== 0 && scale.y !== 0 && scale.z !== 0) { - this.hoverIndicator.scale.divide(scale); - } else { - // Avoid division by zero - this.hoverIndicator.scale.set(1, 1, 1); - } + // if (this.object.scale.x !== 0 && this.object.scale.y !== 0 && this.object.scale.z !== 0) { + // this.hoverIndicator.scale.divide(this.object.scale); + // } // Position the sprite at the center of the object, in local space. this.hoverIndicator.position.copy(boundingSphere.center).sub(this.object.position);