Go to file
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
.claude Fix physics issues: sleep behavior, center of mass, and input scaling 2025-11-24 14:03:32 -06:00
.github/workflows increased heap space. 2025-10-28 12:01:29 -05:00
docs Add Blender export tooling and refactor asset structure 2025-11-06 12:25:34 -06:00
public Fix physics issues: sleep behavior, center of mass, and input scaling 2025-11-24 14:03:32 -06:00
scripts Implement hybrid level storage system with JSON-based defaults and configurable orbit constraints 2025-11-11 18:40:01 -06:00
src Fix physics issues: sleep behavior, center of mass, and input scaling 2025-11-24 14:03:32 -06:00
themes/default Add centralized input control management and mission brief improvements 2025-11-21 17:25:11 -06:00
.gitignore Initial Commit 2025-02-15 11:19:24 -06:00
ANALYTICS_IMPLEMENTATION.md Add analytics abstraction layer with intelligent batching 2025-11-12 16:22:28 -06:00
CLAUDE.md Refactor asteroid scaling and reorganize assets 2025-11-10 12:19:31 -06:00
CONTROLLER_THRUST.md Refactor ship controls to force-based physics with world-space transformations 2025-10-31 11:20:31 -05:00
index.html Implement Svelte-based UI architecture with component system 2025-11-21 15:01:17 -06:00
index.html.backup Implement Svelte-based UI architecture with component system 2025-11-21 15:01:17 -06:00
package-lock.json Add centralized input control management and mission brief improvements 2025-11-21 17:25:11 -06:00
package.json Add centralized input control management and mission brief improvements 2025-11-21 17:25:11 -06:00
svelte.config.js Implement Svelte-based UI architecture with component system 2025-11-21 15:01:17 -06:00
tsconfig.json Implement Svelte-based UI architecture with component system 2025-11-21 15:01:17 -06:00
vite.config.ts Implement Svelte-based UI architecture with component system 2025-11-21 15:01:17 -06:00