Fix crash when disabling SoftBody3D while using Jolt Physics
This commit is contained in:
parent
9a3976097f
commit
50e24e24ed
1 changed files with 2 additions and 1 deletions
|
|
@ -74,7 +74,8 @@ JPH::ObjectLayer JoltSoftBody3D::_get_object_layer() const {
|
|||
void JoltSoftBody3D::_space_changing() {
|
||||
JoltObject3D::_space_changing();
|
||||
|
||||
if (in_space()) {
|
||||
// Note that we should not use `in_space()` as the condition here, since we could have cleared the mesh at this point.
|
||||
if (jolt_body != nullptr) {
|
||||
jolt_settings = new JPH::SoftBodyCreationSettings(jolt_body->GetSoftBodyCreationSettings());
|
||||
jolt_settings->mSettings = nullptr;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue