Skip to content
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

Reload kinematic shapes when changing PhysicsBody mode to Kinematic #53118

Merged
merged 2 commits into from
Sep 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/bullet/rigid_body_bullet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ RigidBodyBullet::~RigidBodyBullet() {

void RigidBodyBullet::init_kinematic_utilities() {
kinematic_utilities = memnew(KinematicUtilities(this));
reload_kinematic_shapes();
}

void RigidBodyBullet::destroy_kinematic_utilities() {
Expand Down
2 changes: 0 additions & 2 deletions modules/bullet/space_bullet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,6 @@ bool SpaceBullet::test_body_motion(RigidBodyBullet *p_body, const Transform3D &p

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

btVector3 initial_recover_motion(0, 0, 0);
Expand Down Expand Up @@ -1089,7 +1088,6 @@ int SpaceBullet::test_ray_separation(RigidBodyBullet *p_body, const Transform3D

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

btVector3 recover_motion(0, 0, 0);
Expand Down