diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-08-11 08:04:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-11 08:04:09 +0200 |
commit | 7d43da928f63d247645f54618fea9479cca838d0 (patch) | |
tree | 00e794a3db3c91e67e1fbdc3edad2c2b0e7f8f79 /servers/physics_3d/collision_solver_3d_sat.cpp | |
parent | 2c88e1c15df283be9b67affa24b533f5858bc913 (diff) | |
parent | 4da3a87f7d31dda644f6bd6dc300bd6e4f7eef79 (diff) |
Merge pull request #51490 from nekomatata/clean-character-body
Remove infinite inertia and ray shapes from CharacterBody
Diffstat (limited to 'servers/physics_3d/collision_solver_3d_sat.cpp')
-rw-r--r-- | servers/physics_3d/collision_solver_3d_sat.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/servers/physics_3d/collision_solver_3d_sat.cpp b/servers/physics_3d/collision_solver_3d_sat.cpp index 852e9ecd74..e6a17b3a1a 100644 --- a/servers/physics_3d/collision_solver_3d_sat.cpp +++ b/servers/physics_3d/collision_solver_3d_sat.cpp @@ -2273,13 +2273,11 @@ bool sat_calculate_penetration(const Shape3DSW *p_shape_A, const Transform3D &p_ PhysicsServer3D::ShapeType type_A = p_shape_A->get_type(); ERR_FAIL_COND_V(type_A == PhysicsServer3D::SHAPE_PLANE, false); - ERR_FAIL_COND_V(type_A == PhysicsServer3D::SHAPE_RAY, false); ERR_FAIL_COND_V(p_shape_A->is_concave(), false); PhysicsServer3D::ShapeType type_B = p_shape_B->get_type(); ERR_FAIL_COND_V(type_B == PhysicsServer3D::SHAPE_PLANE, false); - ERR_FAIL_COND_V(type_B == PhysicsServer3D::SHAPE_RAY, false); ERR_FAIL_COND_V(p_shape_B->is_concave(), false); static const CollisionFunc collision_table[6][6] = { @@ -2384,10 +2382,10 @@ bool sat_calculate_penetration(const Shape3DSW *p_shape_A, const Transform3D &p_ CollisionFunc collision_func; if (margin_A != 0.0 || margin_B != 0.0) { - collision_func = collision_table_margin[type_A - 2][type_B - 2]; + collision_func = collision_table_margin[type_A - 1][type_B - 1]; } else { - collision_func = collision_table[type_A - 2][type_B - 2]; + collision_func = collision_table[type_A - 1][type_B - 1]; } ERR_FAIL_COND_V(!collision_func, false); |