diff options
Diffstat (limited to 'servers')
-rw-r--r-- | servers/physics/collision_solver_sat.cpp | 18 | ||||
-rw-r--r-- | servers/visual/shader_language.cpp | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/servers/physics/collision_solver_sat.cpp b/servers/physics/collision_solver_sat.cpp index eefb0f0396..e587485fcb 100644 --- a/servers/physics/collision_solver_sat.cpp +++ b/servers/physics/collision_solver_sat.cpp @@ -341,26 +341,26 @@ public: min_B -= (max_A - min_A) * 0.5; max_B += (max_A - min_A) * 0.5; - real_t dmin = min_B - (min_A + max_A) * 0.5; - real_t dmax = max_B - (min_A + max_A) * 0.5; + min_B -= (min_A + max_A) * 0.5; + max_B -= (min_A + max_A) * 0.5; - if (dmin > 0.0 || dmax < 0.0) { + if (min_B > 0.0 || max_B < 0.0) { separator_axis = axis; return false; // doesn't contain 0 } //use the smallest depth - dmin = Math::abs(dmin); + min_B = -min_B; - if (dmax < dmin) { - if (dmax < best_depth) { - best_depth = dmax; + if (max_B < min_B) { + if (max_B < best_depth) { + best_depth = max_B; best_axis = axis; } } else { - if (dmin < best_depth) { - best_depth = dmin; + if (min_B < best_depth) { + best_depth = min_B; best_axis = -axis; // keep it as A axis } } diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index d399c548f3..f8661638c3 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -2300,7 +2300,7 @@ bool ShaderLanguage::_validate_assign(Node *p_node, const Map<StringName, BuiltI if (p_node->type == Node::TYPE_OPERATOR) { OperatorNode *op = static_cast<OperatorNode *>(p_node); - if (op->type == OP_INDEX) { + if (op->op == OP_INDEX) { return _validate_assign(op->arguments[0], p_builtin_types); } } |