Enable/disable: gravity and static (Bullet and Bullet-featherstone)#887
Open
ahcorde wants to merge 3 commits intoahcorde/7/gravity_staticfrom
Open
Enable/disable: gravity and static (Bullet and Bullet-featherstone)#887ahcorde wants to merge 3 commits intoahcorde/7/gravity_staticfrom
ahcorde wants to merge 3 commits intoahcorde/7/gravity_staticfrom
Conversation
Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
10 tasks
…_bullet Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
caguero
reviewed
Mar 6, 2026
| } | ||
| if (_enabled) | ||
| { | ||
| worldInfo->world->setGravity(worldInfo->gravity); |
Contributor
There was a problem hiding this comment.
Just checking...Why do you need to modify the gravity of the entire world?
|
|
||
| namespace | ||
| { | ||
| std::unordered_map<std::size_t, bool> gravityStates; |
Contributor
There was a problem hiding this comment.
Should we move this global variable to a place where the scope is model?
| body->setGravity(gravity); | ||
| if (!_enabled) | ||
| { | ||
| // Zero out velocities and forces so the body doesn't drift |
Contributor
There was a problem hiding this comment.
Is this behavior consistent in the other physic engines? I'm not sure if the right call here would be to not zero velocities.
| rootMultiBody->setUserIndex(std::size_t(rootID)); | ||
|
|
||
| auto modelID = | ||
| auto modelID = |
| auto modelID = | ||
| this->GenerateIdentity(rootModelID, this->models[rootModelID]); | ||
| const auto *model = this->ReferenceInterface<ModelInfo>(modelID); | ||
| auto *model = this->ReferenceInterface<ModelInfo>(modelID); |
| if (nestedModelIt == this->models.end()) | ||
| continue; | ||
| auto nestedIdentity = this->GenerateIdentity( | ||
| nestedModelID, nestedModelIt->second); |
Contributor
There was a problem hiding this comment.
Nit: There are some 4-space indentation instead of 2-space. Take a look at them for consistency.
| if (!proxy) | ||
| return; | ||
|
|
||
| if (_linkInfo->isStaticOrFixed) |
Contributor
There was a problem hiding this comment.
A tiny optimization but should we move this check before populating proxy?
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.
🎉 New feature
Summary
Test it
Checklist
codecheckpassed (See contributing)Generated-by: Some tips by Cloude Opus 4.6
Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-byandGenerated-bymessages.