diff options
Diffstat (limited to 'servers/physics/body_sw.cpp')
-rw-r--r-- | servers/physics/body_sw.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/servers/physics/body_sw.cpp b/servers/physics/body_sw.cpp index 36511f78ce..b4c3670a7b 100644 --- a/servers/physics/body_sw.cpp +++ b/servers/physics/body_sw.cpp @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */ +/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -87,6 +87,10 @@ void BodySW::update_inertias() { for (int i = 0; i < get_shape_count(); i++) { + if (is_shape_disabled(i)) { + continue; + } + const ShapeSW *shape = get_shape(i); real_t area = get_shape_area(i); @@ -192,7 +196,8 @@ void BodySW::set_param(PhysicsServer::BodyParameter p_param, real_t p_value) { angular_damp = p_value; } break; - default: {} + default: { + } } } @@ -222,7 +227,8 @@ real_t BodySW::get_param(PhysicsServer::BodyParameter p_param) const { return angular_damp; } break; - default: {} + default: { + } } return 0; @@ -470,7 +476,8 @@ void BodySW::integrate_forces(real_t p_step) { _compute_area_gravity_and_dampenings(aa[i].area); stopped = mode == PhysicsServer::AREA_SPACE_OVERRIDE_REPLACE; } break; - default: {} + default: { + } } } } @@ -648,7 +655,7 @@ void BodySW::simulate_motion(const Transform& p_xform,real_t p_step) { linear_velocity=(p_xform.origin - get_transform().origin)/p_step; //compute a FAKE angular velocity, not so easy - Matrix3 rot=get_transform().basis.orthonormalized().transposed() * p_xform.basis.orthonormalized(); + Basis rot=get_transform().basis.orthonormalized().transposed() * p_xform.basis.orthonormalized(); Vector3 axis; real_t angle; |