Rename most rigid_body names to body#718
Merged
Merged
Conversation
Jondolf
added a commit
that referenced
this pull request
May 4, 2025
# Objective Follow-up to #718. `ContactPair` has `entity1`, `entity2`, `body_entity1`, and `body_entity2`, while `ContactConstraint` has `entity1`, `entity2`, `collider_entity1`, and `collider_entity2`. The `entity` specifiers are kind of unnecessary, and it'd be nice if the names were more consistent and `entity1` and `entity2` were more explicit about whether they are the collider or body entities. ## Solution Rename the properties such that both `ContactPair` and `ContactConstraint` have `collider1`, `collider2`, `body1`, and `body2`. --- ## Migration Guide - `ContactPair`: The `entity1` and `entity2` properties are now `collider1` and `collider2`, and `body_entity1` and `body_entity2` are now `body1` and `body2`. - `ContactConstraint`: The `entity1` and `entity2` properties are now `body1` and `body2`, and `collider_entity1` and `collider_entity2` are now `collider1` and `collider2`.
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.
Objective
We have a lot of properties called
rigid_body. In a lot of cases, really the relevant part is that it is just a physics "body", and therigid_qualifier is largely unnecessary. Typically, it's enough to just usebodyfor properties, and it can result in cleaner names.Solution
Rename
rigid_bodyto justbodyforOnCollisionStart,OnCollisionEnd,ColliderOf, and many internal variables and types.Despite using
bodyfor a lot of property names, I think we should still probably keep theRigidprefix for types such asRigidBody.Migration Guide
ColliderQuery::rigid_bodyhas been renamed toof(forColliderOf) and there is a newbodyhelper to get the contained entity directly.