Adjust ResizeGizmo handle appearance and sizing

Updated handle visual properties:
- Changed handle color from yellow to blue for better visibility
- Increased base handle size from 20% to 50% of corner distance
- Modified distance-based scaling multiplier from 0.2 to 1.0 for improved depth perception
- Removed unused HANDLE_SIZE constant

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Michael Mainguy 2025-11-18 04:57:22 -06:00
parent 6643379133
commit 2915717a3a

View File

@ -62,8 +62,6 @@ export class ResizeGizmo {
// Static reference to utility layer // Static reference to utility layer
public static utilityLayer: UtilityLayerRenderer; public static utilityLayer: UtilityLayerRenderer;
// Constants
private static readonly HANDLE_SIZE = 0.05;
constructor(targetMesh: AbstractMesh, xr: WebXRDefaultExperience) { constructor(targetMesh: AbstractMesh, xr: WebXRDefaultExperience) {
this._scene = targetMesh.getScene(); this._scene = targetMesh.getScene();
@ -101,8 +99,8 @@ export class ResizeGizmo {
*/ */
private createMaterial(): void { private createMaterial(): void {
this._handleMaterial = new StandardMaterial('resizeGizmoMaterial', this._utilityLayer.utilityLayerScene); this._handleMaterial = new StandardMaterial('resizeGizmoMaterial', this._utilityLayer.utilityLayerScene);
this._handleMaterial.diffuseColor = Color3.Yellow(); this._handleMaterial.diffuseColor = Color3.Blue();
this._handleMaterial.emissiveColor = Color3.Yellow().scale(0.3); this._handleMaterial.emissiveColor = Color3.Blue().scale(0.3);
} }
/** /**
@ -118,7 +116,7 @@ export class ResizeGizmo {
const worldMatrix = this._targetMesh.getWorldMatrix(); const worldMatrix = this._targetMesh.getWorldMatrix();
// Calculate handle size once (based on corner distance) // Calculate handle size once (based on corner distance)
const handleSize = innerCorners[0].subtract(bboxCenter).length() * .2; const handleSize = innerCorners[0].subtract(bboxCenter).length() * .5;
// Create corner handles // Create corner handles
CORNER_POSITIONS.forEach((cornerDef, index) => { CORNER_POSITIONS.forEach((cornerDef, index) => {
@ -206,7 +204,7 @@ export class ResizeGizmo {
for (const handle of this._handles) { for (const handle of this._handles) {
const distance = Vector3.Distance(camera.globalPosition, handle.position); const distance = Vector3.Distance(camera.globalPosition, handle.position);
const scaleFactor = distance * 0.2; // Adjust multiplier to control visual size const scaleFactor = distance; // Adjust multiplier to control visual size
handle.scaling = new Vector3(scaleFactor, scaleFactor, scaleFactor); handle.scaling = new Vector3(scaleFactor, scaleFactor, scaleFactor);
} }
} }