summaryrefslogtreecommitdiff
path: root/servers/physics_3d
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-11-18 09:27:23 +0100
committerGitHub <noreply@github.com>2021-11-18 09:27:23 +0100
commitc6555cafa5fb1d86169081f80eb7a4af38238bb2 (patch)
tree50b2a3aab97686e6ed0aa8ae5ab858ef8b8083c4 /servers/physics_3d
parent27691637ab535ff7995ffde3b1fb13019ab5f04f (diff)
parentea52c683375e73df6bb66b90d7250a046ff20da4 (diff)
Merge pull request #55074 from nekomatata/fix-soft-body-gravity
Diffstat (limited to 'servers/physics_3d')
-rw-r--r--servers/physics_3d/godot_soft_body_3d.cpp10
-rw-r--r--servers/physics_3d/godot_soft_body_3d.h3
2 files changed, 2 insertions, 11 deletions
diff --git a/servers/physics_3d/godot_soft_body_3d.cpp b/servers/physics_3d/godot_soft_body_3d.cpp
index b8e9ab4fb9..231b8686f5 100644
--- a/servers/physics_3d/godot_soft_body_3d.cpp
+++ b/servers/physics_3d/godot_soft_body_3d.cpp
@@ -964,12 +964,6 @@ void GodotSoftBody3D::apply_forces(const LocalVector<GodotArea3D *> &p_wind_area
}
}
-void GodotSoftBody3D::_compute_area_gravity(const GodotArea3D *p_area) {
- Vector3 area_gravity;
- p_area->compute_gravity(get_transform().get_origin(), area_gravity);
- gravity += area_gravity;
-}
-
Vector3 GodotSoftBody3D::_compute_area_windforce(const GodotArea3D *p_area, const Face *p_face) {
real_t wfm = p_area->get_wind_force_magnitude();
real_t waf = p_area->get_wind_attenuation_factor();
@@ -987,12 +981,12 @@ void GodotSoftBody3D::predict_motion(real_t p_delta) {
ERR_FAIL_COND(!get_space());
- int ac = areas.size();
-
bool gravity_done = false;
+ Vector3 gravity;
LocalVector<GodotArea3D *> wind_areas;
+ int ac = areas.size();
if (ac) {
areas.sort();
const AreaCMP *aa = &areas[0];
diff --git a/servers/physics_3d/godot_soft_body_3d.h b/servers/physics_3d/godot_soft_body_3d.h
index c03951959f..5198186b5d 100644
--- a/servers/physics_3d/godot_soft_body_3d.h
+++ b/servers/physics_3d/godot_soft_body_3d.h
@@ -101,8 +101,6 @@ class GodotSoftBody3D : public GodotCollisionObject3D {
real_t drag_coefficient = 0.0; // [0,1]
LocalVector<int> pinned_vertices;
- Vector3 gravity;
-
SelfList<GodotSoftBody3D> active_list;
Set<GodotConstraint3D *> constraints;
@@ -113,7 +111,6 @@ class GodotSoftBody3D : public GodotCollisionObject3D {
uint64_t island_step = 0;
- _FORCE_INLINE_ void _compute_area_gravity(const GodotArea3D *p_area);
_FORCE_INLINE_ Vector3 _compute_area_windforce(const GodotArea3D *p_area, const Face *p_face);
public: