|
|
@ -432,16 +432,13 @@ export class Item { |
|
|
boundingBox.getBoundingSphere(boundingSphere); |
|
|
boundingBox.getBoundingSphere(boundingSphere); |
|
|
|
|
|
|
|
|
// Set the desired world scale for the indicator based on the object's size
|
|
|
// 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); |
|
|
this.hoverIndicator.scale.set(desiredScale, desiredScale, desiredScale); |
|
|
|
|
|
|
|
|
// Counteract the parent's scale by dividing the indicator's scale by the parent's scale.
|
|
|
// 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) { |
|
|
// if (this.object.scale.x !== 0 && this.object.scale.y !== 0 && this.object.scale.z !== 0) {
|
|
|
this.hoverIndicator.scale.divide(scale); |
|
|
// this.hoverIndicator.scale.divide(this.object.scale);
|
|
|
} else { |
|
|
// }
|
|
|
// Avoid division by zero
|
|
|
|
|
|
this.hoverIndicator.scale.set(1, 1, 1); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Position the sprite at the center of the object, in local space.
|
|
|
// Position the sprite at the center of the object, in local space.
|
|
|
this.hoverIndicator.position.copy(boundingSphere.center).sub(this.object.position); |
|
|
this.hoverIndicator.position.copy(boundingSphere.center).sub(this.object.position); |
|
|
|