Refactor Create Bodies From Parser [SYNTH-215]#1385
Draft
azaleacolburn wants to merge 12 commits into
Draft
Conversation
…refactor-create-bodies-from-parser
azaleacolburn
force-pushed
the
colbura/215/refactor-create-bodies-from-parser
branch
from
July 8, 2026 16:31
65b5302 to
ac5aad5
Compare
[SYNTH-215]
azaleacolburn
marked this pull request as draft
July 8, 2026 21:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task
SYNTH-215
Symptom
The
createBodiesFromParsermethod inPhysicsSystem.tswas 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
createBodiesFromParsermethod 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 thePhysicsSystemclass.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: