summaryrefslogtreecommitdiffstats
path: root/core/variant/variant_utility.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add const lvalue ref to core/* container parametersMuller-Castro2024-02-141-3/+3
|
* GDScript: Fix incorrect error message for utility functionsDanil Alexeev2023-10-161-28/+106
|
* Add type_string() utilityJakub Janšta2023-10-021-0/+6
|
* Merge pull request #80844 from dalexeev/fix-callable-expected-argcRémi Verschelde2023-10-021-13/+12
|\ | | | | | | Fix expected argument count for `Callable` call errors
| * Fix expected argument count for `Callable` call errorsDanil Alexeev2023-09-291-13/+12
| |
* | Add rotate_toward and angle_difference to GDScript and C#etti2023-10-011-0/+10
|/
* [Core] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicableA Thousand Ships2023-09-111-1/+1
|
* Add a type conversion method to Variant Utility and expose to scriptingAaron Franke2023-09-081-0/+85
|
* Add inverse hyperbolic functions `asinh()`, `acosh()` & `atanh()`Jcrespo2023-09-011-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GDScript has the following built-in trigonometry functions: - `sin()` - `cos()` - `tan()` - `asin()` - `acos()` - `atan()` - `atan()` - `sinh()` - `cosh()` - `tanh()` However, it lacks the hyperbolic arc (also known as inverse hyperbolic) functions: - `asinh()` - `acosh()` - `atanh()` Implement them by just exposing the C++ Math library, but clamping its values to the closest real defined value. For the cosine, clamp input values lower than 1 to 1. In the case of the tangent, where the limit value is infinite, clamp it to -inf or +inf. References #78377 Fixes godotengine/godot-proposals#7110
* Make a header for VariantUtilityFunctionsAaron Franke2023-06-121-787/+784
|
* Redo how the remote filesystem worksJuan Linietsky2023-05-081-0/+2
| | | | | | | | | Instead of reading files over the network, the new version uses a local file cache and only updates files when it changes. The original remote filesystem was created 14 years ago, when ethernet was faster than hard drives or even flash. Also, mobile devices have a very small amount of storage. Nowadays, this is no longer the case so the approach is changed to using a persistent cache in the target device. Co-authored-by: m4gr3d
* Fix lerp error messagePaweł2023-04-211-0/+1
|
* Fix type check for max/minNinni Pipping2023-03-111-2/+10
|
* Make max() and min() global functions only accept numbersGeorge Marques2023-02-241-0/+14
| | | | | The behavior for those are not well defined for non-numeric arguments. To avoid confusion the other types are forbidden.
* Add `@GlobalScope` `is_same(a, b)` and `Variant::identity_compare()`Adam Scott2023-01-251-0/+7
|
* One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
| | | | | | | | | | | | | | | | | | | | 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".
* Merge pull request #68386 from MewPurPur/snappedi-snappedfRémi Verschelde2022-11-241-3/+84
|\ | | | | | | Implement snappedi, snappedf, and Vector[2/3/4]i.snapped
| * Implement snappedi, snappedf, and Vector[2/3/4]i.snappedVolTer2022-11-191-3/+84
| |
* | Refactor Curve3D::_bake() methodYaohua Xiong2022-11-241-0/+5
| | | | | | | | | | | | | | | | | | | | The main change is to caculate tangent directly from bezier curve, without going through discretized polyline, avoiding pitfalls of discretization. Other changes are: 1. Add an bezier_derivative() method for Vector3, Vector2, and Math; 2. Add an tesselate_even_length() method to Curve3D, which tesselate bezier curve to even length segments adaptively; 3. Cache the tangent vectors in baked_tangent_vector_cache;
* | Add case for Variant::INT in lerp variant switchXpertice2022-11-221-0/+3
|/
* Add `is_finite` method for checking built-in typesHaoyu Qiu2022-10-081-0/+5
|
* Use 64bit integers in utility methodskobewi2022-09-281-6/+6
|
* Fix wrong floori() behaviorkobewi2022-09-271-1/+1
|
* Rename `range_lerp` to `remap`Micky2022-09-061-3/+3
|
* Add linear/cubic angle interpolation to Animation interpolation typeSilc Renew2022-08-271-0/+11
|
* Rename `str2var` to `str_to_var` and similarMicky2022-08-261-24/+24
| | | | | | | | | | | | | | | | | | Affects the Math class, a good chunk of the audio code, and a lot of other miscellaneous classes, too. - `var2str` -> `var_to_str` - `str2var` -> `str_to_var` - `bytes2var` -> `bytes_to_var` - `bytes2var_with_objects` -> `bytes_to_var_with_objects` - `var2bytes` -> `var_to_bytes` - `var2bytes_with_objects` -> `var_to_bytes_with_objects` - `linear2db` -> `linear_to_db` - `db2linear` -> `db_to_linear` - `deg2rad` -> `deg_to_rad` - `rad2deg` -> `rad_to_deg` - `dict2inst` -> `dict_to_inst` - `inst2dict` -> `inst_to_dict`
* Make `cubic_interpolate()` consider key time in animationSilc Renew2022-08-191-0/+6
|
* Merge pull request #63361 from KoBeWi/floorf_lolRémi Verschelde2022-08-061-9/+102
|\
| * Split ceil(), floor() and round() methodkobewi2022-07-271-10/+102
| |
* | Restore old lerp() behavior and add lerpf()kobewi2022-08-061-3/+40
|/
* Implement Vector4, Vector4i, Projectionreduz2022-07-231-0/+12
| | | | | | | | | | | | | Implement built-in classes Vector4, Vector4i and Projection. * Two versions of Vector4 (float and integer). * A Projection class, which is a 4x4 matrix specialized in projection types. These types have been requested for a long time, but given they were very corner case they were not added before. Because in Godot 4, reimplementing parts of the rendering engine is now possible, access to these types (heavily used by the rendering code) becomes a necessity. **Q**: Why Projection and not Matrix4? **A**: Godot does not use Matrix2, Matrix3, Matrix4x3, etc. naming convention because, within the engine, these types always have a *purpose*. As such, Godot names them: Transform2D, Transform3D or Basis. In this case, this 4x4 matrix is _always_ used as a _Projection_, hence the naming.
* Adding print_rich for printing with BBCodeVoylin2022-06-291-0/+17
|
* Merge pull request #62449 from Chaosus/wrap_funcRémi Verschelde2022-06-271-0/+47
|\ | | | | Add generalized version of `wrap` function
| * Add generalized version of `wrap` functionYuri Rubinsky2022-06-271-0/+47
| |
* | Refactor bezier interpolation functionsHendrik Brucker2022-06-271-0/+5
|/
* Clean up Hash Functionsreduz2022-06-201-6/+6
| | | | | | | Clean up and do fixes to hash functions and newly introduced murmur3 hashes in #61934 * Clean up usage of murmur3 * Fixed usages of binary murmur3 on floats (this is invalid) * Changed DJB2 to use xor (which seems to be better)
* Remove `RES` and `REF` typedefs in favor of spelled out `Ref<>`Hugo Locurcio2022-05-031-1/+1
| | | | | | These typedefs don't save much typing compared to the full `Ref<Resource>` and `Ref<RefCounted>`, yet they sometimes introduce confusion among new contributors.
* Style: Partially apply clang-tidy's `cppcoreguidelines-pro-type-member-init`Rémi Verschelde2022-05-021-7/+7
| | | | | | | | | | | Didn't commit all the changes where it wants to initialize a struct with `{}`. Should be reviewed in a separate PR. Option `IgnoreArrays` enabled for now to be conservative, can be disabled to see if it proposes more useful changes. Also fixed manually a handful of other missing initializations / moved some from constructors.
* Fix some issues found by cppcheck.bruvzg2022-04-061-36/+36
|
* VariantUtility: Unexpose `Math::range_step_decimals`Rémi Verschelde2022-03-071-5/+0
| | | | | | | This method was meant only as a convenience for editor code to allow using a step of 0 to disable snapping. It was exposed by mistake when refactoring GlobalScope.
* Implement cubic_interpolate() as MathFunc for refactoringSilc 'Tokage' Renew2022-02-121-0/+5
|
* Rename Variant::is_ref() to is_ref_counted()Pedro J. Estébanez2022-01-201-1/+1
|
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Expose `randfn` to global scopeYuri Roubinsky2021-11-171-0/+5
|
* Rename built-in `SGN()` macro to `SIGN()`Hugo Locurcio2021-11-161-4/+4
| | | | | This matches the name of the GDScript function (except it's uppercase here).
* reimplement ping-pongSilc 'Tokage' Renew2021-11-031-0/+5
|
* Revert "Implement reverse playback and ping-pong loop in AnimationPlayer and ↵Juan Linietsky2021-10-111-5/+0
| | | | NodeAnimation"
* Merge pull request #48332 from TokageItLab/implement-ping-pongRémi Verschelde2021-10-111-0/+5
|\
| * implement ping-pong loop in animationTokage2021-10-091-0/+5
| | | | | | | | Co-authored-by: Chaosus <chaosus89@gmail.com>
* | Fix autocompletion of built-in functions in GDScriptYuri Roubinsky2021-10-111-0/+22
|/