Skip to content

Refactor Create Bodies From Parser [SYNTH-215]#1385

Draft
azaleacolburn wants to merge 12 commits into
devfrom
colbura/215/refactor-create-bodies-from-parser
Draft

Refactor Create Bodies From Parser [SYNTH-215]#1385
azaleacolburn wants to merge 12 commits into
devfrom
colbura/215/refactor-create-bodies-from-parser

Conversation

@azaleacolburn

@azaleacolburn azaleacolburn commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Task

SYNTH-215

Symptom

The createBodiesFromParser method in PhysicsSystem.ts was very messy and difficult to debug (for me at least).

This was especially a problem because when updating the version of JoltPhysics.js we use, in SYNTH-211, the createBodiesFromParser method stopped working. After reviewing the Jolt changlog between versions 0.31.0 and 1.0.1, I determined that this was likely an existing bug in the method that went unnoticed before.

In order to properly debug this function, I thought it would be helpful to first refactor it.

Solution

In addition to general refactoring, a new file has been created src/systems/physics/CreateBodiesFromParser.ts, which exposes one function, createBodiesFromParser, which is assigned to the method of the same name on the PhysicsSystem class.

I think this is a pattern we should continue using for every bundle of methods that supply some functionality to the physics system, as having one 2000 line file isn't very maintainable, especially not one cluttered with helper functions.

Verification

All tests still pass.


Before merging, ensure the following criteria are met:

  • All acceptance criteria outlined in the ticket are met.
  • Necessary test cases have been added and updated.
  • A feature toggle or safe disable path has been added (if applicable).
  • User-facing polish:
    • Ask: "Is this ready-looking?"
  • Cross-linking between Jira and GitHub:
    • PR links to the relevant Jira issue.
    • Jira ticket has a comment referencing this PR.

@azaleacolburn
azaleacolburn requested review from a team as code owners July 8, 2026 16:06
@azaleacolburn
azaleacolburn force-pushed the colbura/215/refactor-create-bodies-from-parser branch from 65b5302 to ac5aad5 Compare July 8, 2026 16:31
@AlexD717 AlexD717 changed the title Refactor Create Bodies From Parser Refactor Create Bodies From Parser [SYNTH-215] Jul 8, 2026
@azaleacolburn
azaleacolburn marked this pull request as draft July 8, 2026 21:10
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