mirror of
https://github.com/godotengine/godot-visual-script.git
synced 2026-01-03 10:09:19 +03:00
Merge pull request #7787 from SaracenOne/nan_and_inf
Inf and NaN support added to GDScript
This commit is contained in:
@@ -558,6 +558,12 @@ Error VisualScriptExpression::_get_token(Token& r_token) {
|
||||
} else if (id=="PI") {
|
||||
r_token.type=TK_CONSTANT;
|
||||
r_token.value=Math_PI;
|
||||
} else if (id == "INF") {
|
||||
r_token.type = TK_CONSTANT;
|
||||
r_token.value = Math_INF;
|
||||
} else if (id == "NAN") {
|
||||
r_token.type = TK_CONSTANT;
|
||||
r_token.value = Math_NAN;
|
||||
} else if (id=="not") {
|
||||
r_token.type=TK_OP_NOT;
|
||||
} else if (id=="or") {
|
||||
|
||||
@@ -1738,6 +1738,8 @@ const char* VisualScriptMathConstant::const_name[MATH_CONSTANT_MAX]={
|
||||
"PI/2",
|
||||
"E",
|
||||
"Sqrt2",
|
||||
"INF",
|
||||
"NAN"
|
||||
};
|
||||
|
||||
double VisualScriptMathConstant::const_value[MATH_CONSTANT_MAX]={
|
||||
@@ -1746,7 +1748,9 @@ double VisualScriptMathConstant::const_value[MATH_CONSTANT_MAX]={
|
||||
Math_PI*2,
|
||||
Math_PI*0.5,
|
||||
2.71828182845904523536,
|
||||
Math::sqrt(2.0)
|
||||
Math::sqrt(2.0),
|
||||
Math_INF,
|
||||
Math_NAN
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -467,7 +467,9 @@ public:
|
||||
MATH_CONSTANT_HALF_PI,
|
||||
MATH_CONSTANT_E,
|
||||
MATH_CONSTANT_SQRT2,
|
||||
MATH_CONSTANT_MAX,
|
||||
MATH_CONSTANT_INF,
|
||||
MATH_CONSTANT_NAN,
|
||||
MATH_CONSTANT_MAX
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user