diff options
Diffstat (limited to 'modules/visual_script')
-rw-r--r-- | modules/visual_script/visual_script_expression.cpp | 3 | ||||
-rw-r--r-- | modules/visual_script/visual_script_nodes.cpp | 6 | ||||
-rw-r--r-- | modules/visual_script/visual_script_nodes.h | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/modules/visual_script/visual_script_expression.cpp b/modules/visual_script/visual_script_expression.cpp index 897e910f20..07dca4b904 100644 --- a/modules/visual_script/visual_script_expression.cpp +++ b/modules/visual_script/visual_script_expression.cpp @@ -564,6 +564,9 @@ Error VisualScriptExpression::_get_token(Token &r_token) { } else if (id == "PI") { r_token.type = TK_CONSTANT; r_token.value = Math_PI; + } else if (id == "TAU") { + r_token.type = TK_CONSTANT; + r_token.value = Math_TAU; } else if (id == "INF") { r_token.type = TK_CONSTANT; r_token.value = Math_INF; diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp index d3cd839cf3..3863fa7e1c 100644 --- a/modules/visual_script/visual_script_nodes.cpp +++ b/modules/visual_script/visual_script_nodes.cpp @@ -1776,8 +1776,8 @@ VisualScriptBasicTypeConstant::VisualScriptBasicTypeConstant() { const char *VisualScriptMathConstant::const_name[MATH_CONSTANT_MAX] = { "One", "PI", - "PIx2", "PI/2", + "TAU", "E", "Sqrt2", "INF", @@ -1787,8 +1787,8 @@ const char *VisualScriptMathConstant::const_name[MATH_CONSTANT_MAX] = { double VisualScriptMathConstant::const_value[MATH_CONSTANT_MAX] = { 1.0, Math_PI, - Math_PI * 2, Math_PI * 0.5, + Math_TAU, 2.71828182845904523536, Math::sqrt(2.0), Math_INF, @@ -1886,8 +1886,8 @@ void VisualScriptMathConstant::_bind_methods() { BIND_ENUM_CONSTANT(MATH_CONSTANT_ONE); BIND_ENUM_CONSTANT(MATH_CONSTANT_PI); - BIND_ENUM_CONSTANT(MATH_CONSTANT_2PI); BIND_ENUM_CONSTANT(MATH_CONSTANT_HALF_PI); + BIND_ENUM_CONSTANT(MATH_CONSTANT_TAU); BIND_ENUM_CONSTANT(MATH_CONSTANT_E); BIND_ENUM_CONSTANT(MATH_CONSTANT_SQRT2); BIND_ENUM_CONSTANT(MATH_CONSTANT_INF); diff --git a/modules/visual_script/visual_script_nodes.h b/modules/visual_script/visual_script_nodes.h index 421409b265..6648f57e7b 100644 --- a/modules/visual_script/visual_script_nodes.h +++ b/modules/visual_script/visual_script_nodes.h @@ -474,8 +474,8 @@ public: enum MathConstant { MATH_CONSTANT_ONE, MATH_CONSTANT_PI, - MATH_CONSTANT_2PI, MATH_CONSTANT_HALF_PI, + MATH_CONSTANT_TAU, MATH_CONSTANT_E, MATH_CONSTANT_SQRT2, MATH_CONSTANT_INF, |