From 622e0a52596bb368f3e2f89489fb018b8e74537c Mon Sep 17 00:00:00 2001 From: Michael Mainguy Date: Mon, 24 Nov 2025 17:53:31 -0600 Subject: [PATCH] Fix VR pointer interaction with GUI by removing restrictive picking predicate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolved issue where VR laser pointers could not click mission brief buttons. Root cause was scene.pointerMovePredicate filtering out GUI meshes before pointer events could reach AdvancedDynamicTexture. Changes: - Commented out restrictive pointerMovePredicate that blocked GUI mesh picking - Temporarily disabled renderingGroupId=3 on mission brief for VR compatibility - Adjusted ship physics: reduced angular force multiplier (1.5→0.5) and increased damping (0.5→0.6) Technical details: - WebXRControllerPointerSelection uses scene.pointerMovePredicate during pickWithRay() - If predicate returns false, pickInfo.hit=false and GUI events never fire - AdvancedDynamicTexture requires pickInfo.pickedMesh === mesh to process events - Removing predicate allows default behavior (all isPickable meshes are candidates) TODO: Re-implement predicate using renderingGroupId === 3 check for production 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/core/gameConfig.ts | 4 ++-- src/main.ts | 4 ++-- src/ui/hud/missionBrief.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/gameConfig.ts b/src/core/gameConfig.ts index 480f03f..ed4f4d8 100644 --- a/src/core/gameConfig.ts +++ b/src/core/gameConfig.ts @@ -5,11 +5,11 @@ const DEFAULT_SHIP_PHYSICS = { maxLinearVelocity: 200, maxAngularVelocity: 1.4, linearForceMultiplier: 500, - angularForceMultiplier: 1.5, + angularForceMultiplier: .5, linearFuelConsumptionRate: 0.0002778, // 1 minute at full thrust (60 Hz) angularFuelConsumptionRate: 0.0001389, // 2 minutes at full thrust (60 Hz) linearDamping: 0.2, - angularDamping: 0.5, // Moderate damping for 2-3 second coast + angularDamping: 0.6, // Moderate damping for 2-3 second coast alwaysActive: true, // Prevent physics sleep (false may cause abrupt stops at zero velocity) reverseThrustFactor: 0.3 // Reverse thrust at 50% of forward thrust power }; diff --git a/src/main.ts b/src/main.ts index 9d6b2b3..0ed1906 100644 --- a/src/main.ts +++ b/src/main.ts @@ -540,10 +540,10 @@ export class Main { debugLog("Pointer selection feature registered with InputControlManager"); // Configure scene-wide picking predicate to only allow UI meshes - DefaultScene.MainScene.pointerMovePredicate = (mesh) => { + /*DefaultScene.MainScene.pointerMovePredicate = (mesh) => { // Only allow picking meshes with metadata.uiPickable = true return mesh.metadata?.uiPickable === true; - }; + };*/ debugLog("Scene picking predicate configured for VR UI only"); } diff --git a/src/ui/hud/missionBrief.ts b/src/ui/hud/missionBrief.ts index 371627b..ee54b64 100644 --- a/src/ui/hud/missionBrief.ts +++ b/src/ui/hud/missionBrief.ts @@ -46,7 +46,7 @@ export class MissionBrief { mesh.parent = ship; mesh.position = new Vector3(0,1,2.8); - mesh.renderingGroupId = 3; // Same as status screen for consistent rendering + //mesh.renderingGroupId = 3; // Same as status screen for consistent rendering mesh.metadata = { uiPickable: true }; // TAG: VR UI - allow pointer selection console.log('[MissionBrief] Mesh parented to ship at position:', mesh.position); console.log('[MissionBrief] Mesh absolute position:', mesh.getAbsolutePosition());