-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved Bullet Physics flush algorithm, Lazy collision filter reload, Shape reload regression fix. #40252
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think trying to control the order that the flush happens is the right approach; especially not by creating multiple queues, which significantly increases the complexity of the flush system without the flexibility of varying the number of priorities.
Also, as highlighted below, your solution appears to require the Standard Template Library's std::vector
, which I thought we shouldn't be using.
The old solution was really bad because all the rigid bodies are processed, even the one that are not needed. Instead, the queue allows to only process the The solution of single queue, has the big disadvantage that before its use it must be sorted. This is acceptable when each element can have N priorities. For this use case, we have just 2 priorities (and this is unlikely to change), so use two separate queues is much more convenient. Regarding the |
e7a3453
to
d0b8d3d
Compare
Update: Rebased and fixed some bugs listed in the main post. |
Removed |
Force push: Removed invalid comment, It was no more valid since |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't tested whether or not this PR solves the issues indicated, but aside from the few minor points below I think the changes look good. 👍
- Flushing Areas before anything else. - Make sure to correctly fetch gravity when the integrate_forces function is used - Lazy reload body when layer and mask changes - Shapes are reloaded just before the physics step starts. - Improved some other parts of the code. - Added override keyword - Using LocalVector
All fixed |
Thanks! |
Vector<Vector3> contactDebug; | ||
int contactDebugCount = 0; | ||
LocalVector<Vector3> contactDebug; | ||
uint32_t contactDebugCount = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't these be snake_case
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, it should be. Also I would check if make sense remove it (now that we have LocalVector
)
std::vector
andVector
in favour of the recently addedLocalVector
.Check this PR: #40186
Improves this: #40127
Fixes #40508
Fixes #40311
Fixes #40506