A common bug with using acos and asin is that input outside -1 to 1 range will result in Nan output. This can occur due to floating point error in the input.
The standard solution is to provide safe_acos function with clamped input. For Godot it may make more sense to make the standard functions safe.
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.
It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).
We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).
Also fixed "cf." Frenchism - it's meant as "refer to / see".
Backported from #70885.
This is achieved by skipping initializer call while creating an instance
of a GDScript. This is implemented by passing -1 as an argument count
to `_new` and interpreting any value below 0 to mean that the initializer
should not be called during instantiation, because internal members of
an instance are going to be overridden afterwards.
Implement a special case for allowing "pass" keyword in one-liner class
declaration, to be consistent with Python style.
```
class TestClass: pass
```
This commit fixes#56703
* GDScriptLanguage::complete_code already adds parentheses to function calls, and does this a lot smarter than the language server right now.
* Instead of the previous naive approach we now reuse the same logic as the internal editor.
* For this to have any effect we also have to send the `insertText` field already during the completionRequest and not only during resolve.
(cherry picked from commit bbb07ff8cb)
Backports features and bugfixes from current Godot 4.0 to 3.5 and brings functions and codebase of both version largely in sync to make tutorials more compatible and future backports easier.
Rewrites the definition of how the function works.
Reworks the style of the examples and adds a negative range example.
Changes the while loop to a range loop in the array backwards example.
(cherry picked from commit b2841ce194)
This makes it easier to spot syntax errors when editing the
class reference. The schema is referenced locally so validation
can still work offline.
Each class XML's schema conformance is also checked on GitHub Actions.
This behavior is inconsistent with non tools builds and can create
issues. Instead, a warning is emitted if there's a type mismatch. If the
type can't be converted, an error is shown instead.
For the editor it gives a converted value to avoid issues with the
property editor, which expects the correct type.