Skip to content

refactor(physics): split rigid-body data classes into separate modules#8897

Merged
willeastcott merged 1 commit into
mainfrom
refactor/split-rigidbody-data-classes
Jun 14, 2026
Merged

refactor(physics): split rigid-body data classes into separate modules#8897
willeastcott merged 1 commit into
mainfrom
refactor/split-rigidbody-data-classes

Conversation

@willeastcott

Copy link
Copy Markdown
Contributor

Description

Splits the four public physics data classes — RaycastResult, SingleContactResult, ContactPoint, and ContactResult — out of rigid-body/system.js into their own one-class modules, leaving RigidBodyComponentSystem as the only class in system.js.

They are pure data containers with no dependency on the system (the system constructs/pools them, not the reverse), so the move is behavior-neutral and the public API is unchanged — all five classes remain exported from src/index.js (pc.RaycastResult, etc.). This matches the engine's one-class-per-file convention (cf. collision/trigger.js) and trims system.js from ~1110 to ~790 lines.

Checklist

  • I have read the contributing guidelines
  • My code follows the project's coding standards
  • This PR focuses on a single change

🤖 Generated with Claude Code

Move RaycastResult, SingleContactResult, ContactPoint and ContactResult out of system.js into their own one-class modules, matching the engine's one-class-per-file convention. Behavior-neutral; the public API is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@willeastcott willeastcott self-assigned this Jun 14, 2026
@willeastcott willeastcott added area: physics Physics related issue enhancement Request for a new feature labels Jun 14, 2026
@willeastcott willeastcott merged commit 3a137f2 into main Jun 14, 2026
9 checks passed
@willeastcott willeastcott deleted the refactor/split-rigidbody-data-classes branch June 14, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: physics Physics related issue enhancement Request for a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant