summaryrefslogtreecommitdiffstats
path: root/core/variant/variant_utility.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
|/
* Add `print_verbose()` built-in function to print in verbose mode onlyHugo Locurcio2021-09-211-20/+23
| | | | | | | | | | This can be used as a shorthand for: if OS.is_stdout_verbose(): print("...") Unlike `print_debug()`, this works in release builds too and can be toggled off in debug builds.
* Remove cartesian2polar and polar2cartesiankobewi2021-08-311-11/+0
|
* Expose RID creation utilities.reduz2021-08-231-0/+12
| | | | | * Exposed as utility functions. * Not very useful for script, but vital for creating servers using native extensions.
* Merge pull request #38992 from Dragoncraft89/masterRémi Verschelde2021-08-111-0/+9
|\ | | | | Error handling functions for GdScript
| * Add error_string functionFlorian Kothmeier2021-04-271-0/+9
| |
* | Remove obsolete "dectime" methodAaron Franke2021-07-301-5/+0
| | | | | | | | Replaced by "move_toward"
* | Use const references where possible for List range iteratorsRémi Verschelde2021-07-251-1/+1
| |
* | Use C++ iterators for Lists in many situationsAaron Franke2021-07-231-2/+2
| |
* | Implement native extension systemreduz2021-06-251-1/+18
| | | | | | | | | | | | * Deprecates GDNative in favor of a simpler, lower level interface. * New extension system allows registering core engine classes. * Simple header interface in gdnative_interace.h
* | Rename Reference to RefCountedPedro J. Estébanez2021-06-111-1/+1
| |
* | Re-bind posmod, use int64_t instead of intRémi Verschelde2021-05-041-0/+5
|/ | | | | | | Fixes #48420, fixes #48421. The binding was missed when moving GDScript built-in to Global Scope it seems. Co-authored-by: kleonc <9283098+kleonc@users.noreply.github.com>
* Merge pull request #44661 from AndreaCatania/AndreaCatania-patch-5Rémi Verschelde2021-01-051-2/+2
|\ | | | | Fixes: GDscript min and max are inverted
| * Fixes: GDscript min and max are invertedAndrea Catania2020-12-241-2/+2
| |
* | Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* | Rename Math::stepify to snappedMarcel Admiraal2020-12-281-3/+3
| |