Fix VR pointer interaction with GUI by removing restrictive picking predicate
All checks were successful
Build / build (push) Successful in 1m34s

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 <noreply@anthropic.com>
This commit is contained in:
Michael Mainguy 2025-11-24 17:53:31 -06:00
parent fa15fce4ef
commit 622e0a5259
3 changed files with 5 additions and 5 deletions

View File

@ -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
};

View File

@ -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");
}

View File

@ -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());