diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-02-08 09:31:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-08 09:31:08 +0100 |
commit | cea42faa77d72cdbea8ab7c38936e7c8722900d0 (patch) | |
tree | 3c7f54d3b3e6d355a2ffb14933e0b5461478b224 /scene/3d/physics_body_3d.cpp | |
parent | 57e2822a05c29db3980ad243c37a34acf6c4d14b (diff) | |
parent | 003bb8e1a8c9bb81e3cb0733b3f0d569b1518881 (diff) |
Merge pull request #44630 from qarmin/cppcheck_scene_1
Initialize class variables with default values in scene/ [1/2]
Diffstat (limited to 'scene/3d/physics_body_3d.cpp')
-rw-r--r-- | scene/3d/physics_body_3d.cpp | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/scene/3d/physics_body_3d.cpp b/scene/3d/physics_body_3d.cpp index 71be943232..367dd7ec91 100644 --- a/scene/3d/physics_body_3d.cpp +++ b/scene/3d/physics_body_3d.cpp @@ -330,8 +330,8 @@ void RigidBody3D::_body_inout(int p_status, ObjectID p_instance, int p_body_shap struct _RigidBodyInOut { ObjectID id; - int shape; - int local_shape; + int shape = 0; + int local_shape = 0; }; void RigidBody3D::_direct_state_changed(Object *p_state) { @@ -825,24 +825,6 @@ void RigidBody3D::_bind_methods() { RigidBody3D::RigidBody3D() : PhysicsBody3D(PhysicsServer3D::BODY_MODE_RIGID) { - mode = MODE_RIGID; - - mass = 1; - max_contacts_reported = 0; - state = nullptr; - - gravity_scale = 1; - linear_damp = -1; - angular_damp = -1; - - //angular_velocity=0; - sleeping = false; - ccd = false; - - custom_integrator = false; - contact_monitor = nullptr; - can_sleep = true; - PhysicsServer3D::get_singleton()->body_set_force_integration_callback(get_rid(), this, "_direct_state_changed"); } @@ -1221,11 +1203,6 @@ void KinematicBody3D::_direct_state_changed(Object *p_state) { KinematicBody3D::KinematicBody3D() : PhysicsBody3D(PhysicsServer3D::BODY_MODE_KINEMATIC) { - locked_axis = 0; - on_floor = false; - on_ceiling = false; - on_wall = false; - set_safe_margin(0.001); PhysicsServer3D::get_singleton()->body_set_force_integration_callback(get_rid(), this, "_direct_state_changed"); } |