Skip to content

refactor: merge Rigidbody2D and Collider2D into PhysicsBody2D#886

Closed
AnthonyWadham wants to merge 2 commits intoAnthony/add-missing-shapesfrom
Anthony/fix-archtype
Closed

refactor: merge Rigidbody2D and Collider2D into PhysicsBody2D#886
AnthonyWadham wants to merge 2 commits intoAnthony/add-missing-shapesfrom
Anthony/fix-archtype

Conversation

@AnthonyWadham
Copy link
Copy Markdown
Contributor

@AnthonyWadham AnthonyWadham commented Apr 7, 2026

TL;DR

Consolidated Rigidbody2D and Collider2D components into a single PhysicsBody2D component that contains both rigid body parameters and collider shapes.

What changed?

  • Removed the separate Collider2D component and moved its Shapes field into PhysicsBody2D
  • Renamed Rigidbody2D to PhysicsBody2D and added the shapes array to it
  • Updated NewPhysicsBody2D constructor to accept shapes as variadic parameters
  • Modified all internal systems to work with the unified component structure
  • Updated component queries to use PhysicsBody2D instead of separate Rigidbody2D and Collider2D components
  • Renamed internal methods like applyRigidbodyInPlace to applyBodyParamsInPlace and RigidbodyDiffers to BodyParamsDiffer
  • Updated shadow state tracking to use the consolidated component
  • Changed validation and reconciliation logic to handle the unified structure

Why make this change?

This consolidation simplifies the physics component architecture by combining related data (rigid body properties and collision shapes) into a single component, reducing the complexity of managing separate but tightly coupled components and making the physics system more cohesive.

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label graphite/merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@AnthonyWadham AnthonyWadham changed the title fix: merge rigidbody + collider component to physicsBody2D component refactor: merge Rigidbody2D and Collider2D into PhysicsBody2D Apr 7, 2026
@AnthonyWadham AnthonyWadham marked this pull request as ready for review April 7, 2026 16:04
@AnthonyWadham AnthonyWadham force-pushed the Anthony/add-missing-shapes branch from 407ce21 to 2974a4f Compare April 7, 2026 16:05
@AnthonyWadham AnthonyWadham force-pushed the Anthony/fix-archtype branch from 82f0d7c to b84c1ad Compare April 7, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant