diff options
author | Rafał Mikrut <mikrutrafal54@gmail.com> | 2019-12-10 05:13:02 +0100 |
---|---|---|
committer | Rafał Mikrut <mikrutrafal54@gmail.com> | 2019-12-10 05:13:02 +0100 |
commit | ed1c4bc77db88fa0f8f599ca2d3c4b533a94a654 (patch) | |
tree | 45e5f3b02b6f9c62116ba7fb513c87fa1f26a001 /servers | |
parent | 6f38aeef5255d1fdeb99d727a0f67b9be6ccdf36 (diff) |
Removed unused variables, add some constants numbers
Diffstat (limited to 'servers')
-rw-r--r-- | servers/physics/joints/cone_twist_joint_sw.cpp | 2 | ||||
-rw-r--r-- | servers/physics/joints/hinge_joint_sw.cpp | 2 | ||||
-rw-r--r-- | servers/physics_2d/physics_2d_server_sw.cpp | 2 | ||||
-rw-r--r-- | servers/visual/shader_language.cpp | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/servers/physics/joints/cone_twist_joint_sw.cpp b/servers/physics/joints/cone_twist_joint_sw.cpp index 1b3de3e913..cd86128dc3 100644 --- a/servers/physics/joints/cone_twist_joint_sw.cpp +++ b/servers/physics/joints/cone_twist_joint_sw.cpp @@ -53,7 +53,7 @@ Written by: Marcus Hennix static void plane_space(const Vector3 &n, Vector3 &p, Vector3 &q) { - if (Math::abs(n.z) > 0.707106781186547524400844362) { + if (Math::abs(n.z) > Math_SQRT12) { // choose p in y-z plane real_t a = n[1] * n[1] + n[2] * n[2]; real_t k = 1.0 / Math::sqrt(a); diff --git a/servers/physics/joints/hinge_joint_sw.cpp b/servers/physics/joints/hinge_joint_sw.cpp index 209cddda5e..633f0b4921 100644 --- a/servers/physics/joints/hinge_joint_sw.cpp +++ b/servers/physics/joints/hinge_joint_sw.cpp @@ -51,7 +51,7 @@ subject to the following restrictions: static void plane_space(const Vector3 &n, Vector3 &p, Vector3 &q) { - if (Math::abs(n.z) > 0.707106781186547524400844362) { + if (Math::abs(n.z) > Math_SQRT12) { // choose p in y-z plane real_t a = n[1] * n[1] + n[2] * n[2]; real_t k = 1.0 / Math::sqrt(a); diff --git a/servers/physics_2d/physics_2d_server_sw.cpp b/servers/physics_2d/physics_2d_server_sw.cpp index 80e204087a..73baab2dd6 100644 --- a/servers/physics_2d/physics_2d_server_sw.cpp +++ b/servers/physics_2d/physics_2d_server_sw.cpp @@ -174,7 +174,7 @@ void Physics2DServerSW::_shape_col_cbk(const Vector2 &p_point_A, const Vector2 & } Vector2 rel_dir = (p_point_A - p_point_B).normalized(); - if (cbk->valid_dir.dot(rel_dir) < 0.7071) { //sqrt(2)/2.0 - 45 degrees + if (cbk->valid_dir.dot(rel_dir) < Math_SQRT12) { //sqrt(2)/2.0 - 45 degrees cbk->invalid_by_dir++; /* diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 316a94556d..081d1a4892 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -2912,7 +2912,7 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons tk = _get_token(); if (tk.type == TK_PARENTHESIS_OPEN) { //a function - StringName name = identifier; + const StringName &name = identifier; OperatorNode *func = alloc_node<OperatorNode>(); func->op = OP_CALL; |