mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Fix contacts not being reported properly when using Jolt Physics
This commit is contained in:
parent
c6d130abd9
commit
5a16e2fc78
6 changed files with 111 additions and 1 deletions
|
|
@ -161,6 +161,8 @@ void JoltBody3D::_add_to_space() {
|
|||
}
|
||||
|
||||
void JoltBody3D::_enqueue_call_queries() {
|
||||
// This method will be called from the body activation listener on multiple threads during the simulation step.
|
||||
|
||||
if (space != nullptr) {
|
||||
space->enqueue_call_queries(&call_queries_element);
|
||||
}
|
||||
|
|
@ -299,6 +301,14 @@ JPH::MassProperties JoltBody3D::_calculate_mass_properties() const {
|
|||
return _calculate_mass_properties(*jolt_shape);
|
||||
}
|
||||
|
||||
void JoltBody3D::_on_wake_up() {
|
||||
// This method will be called from the body activation listener on multiple threads during the simulation step.
|
||||
|
||||
if (_should_call_queries()) {
|
||||
_enqueue_call_queries();
|
||||
}
|
||||
}
|
||||
|
||||
void JoltBody3D::_update_mass_properties() {
|
||||
if (in_space()) {
|
||||
jolt_body->GetMotionPropertiesUnchecked()->SetMassProperties(_calculate_allowed_dofs(), _calculate_mass_properties());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue