Skip to content

Commit

Permalink
Merge pull request #51857 from nekomatata/bullet-test-body-motion-cra…
Browse files Browse the repository at this point in the history
…sh-3.x

[3.x] Fix crash in body_test_motion when used with RigidBody3D in Bullet
  • Loading branch information
akien-mga authored Aug 18, 2021
2 parents 3daf536 + db47b67 commit 64a4c23
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/bullet/space_bullet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,11 @@ bool SpaceBullet::test_body_motion(RigidBodyBullet *p_body, const Transform &p_f
G_TO_B(p_from, body_transform);
UNSCALE_BT_BASIS(body_transform);

if (!p_body->get_kinematic_utilities()) {
p_body->init_kinematic_utilities();
p_body->reload_kinematic_shapes();
}

btVector3 initial_recover_motion(0, 0, 0);
{ /// Phase one - multi shapes depenetration using margin
for (int t(RECOVERING_MOVEMENT_CYCLES); 0 < t; --t) {
Expand Down Expand Up @@ -1087,6 +1092,11 @@ int SpaceBullet::test_ray_separation(RigidBodyBullet *p_body, const Transform &p
G_TO_B(p_transform, body_transform);
UNSCALE_BT_BASIS(body_transform);

if (!p_body->get_kinematic_utilities()) {
p_body->init_kinematic_utilities();
p_body->reload_kinematic_shapes();
}

btVector3 recover_motion(0, 0, 0);

int rays_found = 0;
Expand Down

0 comments on commit 64a4c23

Please sign in to comment.