Reload kinematic shapes when changing PhysicsBody mode to Kinematic
Prevents a crash when calling test_body_motion. Call reload_kinematic_shapes from init_kinematic_utilities as they are always called together. (cherry picked from commits112985c5bc
and3540e716f9
)
This commit is contained in:
parent
e01d609c02
commit
9de9994444
|
@ -320,6 +320,7 @@ RigidBodyBullet::~RigidBodyBullet() {
|
|||
|
||||
void RigidBodyBullet::init_kinematic_utilities() {
|
||||
kinematic_utilities = memnew(KinematicUtilities(this));
|
||||
reload_kinematic_shapes();
|
||||
}
|
||||
|
||||
void RigidBodyBullet::destroy_kinematic_utilities() {
|
||||
|
|
|
@ -967,7 +967,6 @@ bool SpaceBullet::test_body_motion(RigidBodyBullet *p_body, const Transform &p_f
|
|||
|
||||
if (!p_body->get_kinematic_utilities()) {
|
||||
p_body->init_kinematic_utilities();
|
||||
p_body->reload_kinematic_shapes();
|
||||
}
|
||||
|
||||
btVector3 initial_recover_motion(0, 0, 0);
|
||||
|
@ -1109,7 +1108,6 @@ int SpaceBullet::test_ray_separation(RigidBodyBullet *p_body, const Transform &p
|
|||
|
||||
if (!p_body->get_kinematic_utilities()) {
|
||||
p_body->init_kinematic_utilities();
|
||||
p_body->reload_kinematic_shapes();
|
||||
}
|
||||
|
||||
btVector3 recover_motion(0, 0, 0);
|
||||
|
|
Loading…
Reference in New Issue