space-game/public/levels
Michael Mainguy e31e25f9e5 Fix physics issues: sleep behavior, center of mass, and input scaling
This commit resolves several physics-related issues that were causing
unexpected behavior in ship and asteroid movement:

**Physics Sleep System**
- Fixed abrupt stops by preventing Havok from putting bodies to sleep
- Added PhysicsActivationControl.ALWAYS_ACTIVE for ship and asteroids
- Made ship sleep behavior configurable via shipPhysics.alwaysActive
- Sleep was causing sudden velocity zeroing at low speeds

**Center of Mass Issues**
- Discovered mesh-based physics calculated offset CoM: (0, -0.38, 0.37)
- Override ship center of mass to (0, 0, 0) to prevent thrust torque
- Applying force at offset CoM was creating unwanted pitch rotation
- Added debug logging to track mass properties

**Input Deadzone Improvements**
- Implemented smooth deadzone scaling (0.1-0.15 range)
- Replaced hard threshold cliff with linear interpolation
- Prevents abrupt control cutoff during gentle inputs
- Added VR mode check to disable keyboard fallback in VR

**Configuration System**
- Added DEFAULT_SHIP_PHYSICS constant as single source of truth
- Added tunable parameters: linearDamping, angularDamping, alwaysActive
- Added fuel consumption rates: linearFuelConsumptionRate, angularFuelConsumptionRate
- Tuned for 1 minute linear thrust, 2 minutes angular thrust at 60Hz
- All physics parameters now persist to localStorage

**Other Fixes**
- Changed orbit center to STATIC motion type (was ANIMATED)
- Fixed linear force application point (removed offset)
- Added ship initial velocity support from level config
- Changed physics update from every 10 frames to every physics tick
- Increased linear input threshold from 0.1 to 0.15

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 14:03:32 -06:00
..
1.json Add level configuration system and update base station model 2025-11-11 17:26:18 -06:00
deep-space-patrol.json Implement hybrid level storage system with JSON-based defaults and configurable orbit constraints 2025-11-11 18:40:01 -06:00
directory.json Implement Svelte-based UI architecture with component system 2025-11-21 15:01:17 -06:00
enemy-territory.json Implement hybrid level storage system with JSON-based defaults and configurable orbit constraints 2025-11-11 18:40:01 -06:00
final-challenge.json Implement hybrid level storage system with JSON-based defaults and configurable orbit constraints 2025-11-11 18:40:01 -06:00
rescue-mission.json Implement hybrid level storage system with JSON-based defaults and configurable orbit constraints 2025-11-11 18:40:01 -06:00
rookie-training.json Fix physics issues: sleep behavior, center of mass, and input scaling 2025-11-24 14:03:32 -06:00
the-gauntlet.json Implement hybrid level storage system with JSON-based defaults and configurable orbit constraints 2025-11-11 18:40:01 -06:00