|
@@ -442,12 +442,8 @@ struct _RigidBodyInOut {
|
|
|
};
|
|
|
|
|
|
void RigidBody::_direct_state_changed(Object *p_state) {
|
|
|
-
|
|
|
-#ifdef DEBUG_ENABLED
|
|
|
state = Object::cast_to<PhysicsDirectBodyState>(p_state);
|
|
|
-#else
|
|
|
- state = (PhysicsDirectBodyState *)p_state; //trust it
|
|
|
-#endif
|
|
|
+ ERR_FAIL_COND_MSG(!state, "Method '_direct_state_changed' must receive a valid PhysicsDirectBodyState object as argument");
|
|
|
|
|
|
set_ignore_transform_notification(true);
|
|
|
set_global_transform(state->get_transform());
|
|
@@ -2220,13 +2216,8 @@ void PhysicalBone::_direct_state_changed(Object *p_state) {
|
|
|
|
|
|
/// Update bone transform
|
|
|
|
|
|
- PhysicsDirectBodyState *state;
|
|
|
-
|
|
|
-#ifdef DEBUG_ENABLED
|
|
|
- state = Object::cast_to<PhysicsDirectBodyState>(p_state);
|
|
|
-#else
|
|
|
- state = (PhysicsDirectBodyState *)p_state; //trust it
|
|
|
-#endif
|
|
|
+ PhysicsDirectBodyState *state = Object::cast_to<PhysicsDirectBodyState>(p_state);
|
|
|
+ ERR_FAIL_COND_MSG(!state, "Method '_direct_state_changed' must receive a valid PhysicsDirectBodyState object as argument");
|
|
|
|
|
|
Transform global_transform(state->get_transform());
|
|
|
|