Commit graph

949 commits

Author SHA1 Message Date
Micky
59e11934d8 Rename str2var to str_to_var and similar
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`
2022-08-26 14:58:22 +02:00
Rémi Verschelde
b9919fd87d
Merge pull request #64678 from TokageItLab/implement-ease-baker
Fix Quaternion Tween and add Easing baker to AnimationTrackEditor
2022-08-23 09:19:21 +02:00
kobewi
8be27dc59e Replace Array return types with TypedArray 2022-08-22 22:42:36 +02:00
Rémi Verschelde
7b4927bb5f
Merge pull request #60309 from The-O-King/oct 2022-08-22 19:29:21 +02:00
Rémi Verschelde
944bfc6d00
Merge pull request #63602 from TokageItLab/cubic-interp-time 2022-08-22 17:32:47 +02:00
Silc Renew
f7dd83ce60 Fix Quaternion Tween and implement ease baker 2022-08-22 19:04:58 +09:00
rafallus
da7a5653f4 Expose Basis set_orthogonal_index method as a GridMap function 2022-08-20 21:42:20 -05:00
Silc Renew
dded7c72c1 Make cubic_interpolate() consider key time in animation 2022-08-19 14:48:37 +09:00
Omar El Sheikh
78881b3cc3 Octahedral Normal/Tangent Compression
Implementation of Octahedral normal compression into Godot 4.0
2022-08-13 08:09:32 -07:00
antonWetzel
40a1d6d100 vector4 distance_squared_to and update csharp 2022-08-09 01:59:17 +02:00
Hendrik Brucker
36061c5dca Vector4/Vector4i: Add missing methods, tests and fix change of sign operator 2022-08-07 12:25:05 +02:00
Aaron Franke
88f5b0d563
Check if the axis is zero / vectors are colinear in Vector3 slerp 2022-08-04 14:32:54 -05:00
Fabian Keller
f242f9c738 Fix consistency of translated/scaled/rotated in Transform2D and Transform3D 2022-08-02 23:38:14 +02:00
Raul Santos
2e5cf62dee
Fix Vector4::min_axis_index for equal components
The documentation says if all components are equal it must return AXIS_W but it was returning AXIS_X.
2022-08-01 04:50:17 +02:00
Silc Renew
90dc2f961e Make spherical_cubic_interpolate() more stable 2022-07-29 17:39:22 +09:00
Rémi Verschelde
a5f12f9c21
Merge pull request #63532 from TokageItLab/rename-cubic-slerp 2022-07-28 10:39:33 +02:00
Rémi Verschelde
199ea349f5
Merge pull request #57698 from bluenote10/feature/rename_translated_to_translated_local 2022-07-28 10:03:07 +02:00
Rémi Verschelde
13a9d5e3c0
Merge pull request #63378 from nathanfranke/t3d-errors
Add equal checks to Transform3D::looking_at and Transform3D::set_look_at, fixes misleading error.
2022-07-28 09:25:25 +02:00
Silc Renew
4211e68d80 rename and unify notation for spherical interpolation 2022-07-27 23:22:50 +09:00
Rémi Verschelde
89527db8d3
Merge pull request #63380 from V-Sekai/fix-cubic-slerp-dot 2022-07-27 13:20:02 +02:00
Rémi Verschelde
1c57d90e85
Merge pull request #63463 from KoBeWi/Vector5
Add some missing Vector4 methods
2022-07-27 10:45:39 +02:00
Rémi Verschelde
cda723d201 Color: Fix resetting alpha when setting H/S/V separately
Fixes #63487.
2022-07-26 15:43:49 +02:00
kobewi
7006f7d693 Add some missing Vector4 methods 2022-07-26 02:35:42 +02:00
Nathan Franke
4b13a6dcb8
add equal checks to Transform3D::looking_at and Transform3D::set_look_at 2022-07-25 13:39:40 -05:00
Ricardo Buring
178405f7cb Fixup BVH debugging statements 2022-07-25 18:21:53 +02:00
Silc 'Tokage' Renew
e252d4e6fe Fix cubic_slerp
Co-authored-by: K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>
Co-authored-by: Pasi Nuutinmaki <gnssstylist@sci.fi>
2022-07-25 22:44:39 +09:00
Rémi Verschelde
90019676b0 Code quality: Fix header guards consistency
Adds `header_guards.sh` bash script, used in CI to validate future
changes. Can be run locally to fix invalid header guards.
2022-07-25 11:17:40 +02:00
reduz
455c06ecd4 Implement Vector4, Vector4i, Projection
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.
2022-07-23 14:00:01 +02:00
Yuri Rubinsky
ccc56cc6d4 Rename epsilon to tolerance in the Plane::has_point method 2022-07-21 20:15:15 +03:00
fabriceci
db7c91e0ad Fix the calculation of the angular velocity when the rotation speed is not high. 2022-07-19 10:27:13 +02:00
Fabian Keller
2bf9e6090c rename translate(d) to translate(d)_local in Transform 2D/3D 2022-07-16 11:47:54 +02:00
lawnjelly
1f69666209 Remove Octree
Octree is no longer used in 4.x.
2022-07-06 14:10:05 +01:00
cdemirer
0ccde38668 Expression built-in functions can also be considered as identifiers in subscripts 2022-07-04 13:25:43 +03:00
Rémi Verschelde
b863c40356
Merge pull request #62468 from V-Sekai/core-const-expressions
Add a const call mode to Object, Variant and Script.
2022-06-28 01:08:24 +02:00
Rémi Verschelde
25baa32db0
Merge pull request #62458 from Geometror/interpolation-function-cleanup
Refactor Bezier interpolation functions
2022-06-27 23:25:33 +02:00
K. S. Ernest (iFire) Lee
9ddebc0c22 Add a const call mode to Object, Variant and Script.
For this to work safely (user not call queue_free or something in the expression), a const call mode was added to Object and Variant (and optionally Script).

This mode ensures only const functions can be called, making it safe to use from the editor.

Co-Authored-By: reduz <reduzio@gmail.com>
2022-06-27 13:33:06 -07:00
Hendrik Brucker
99ce0df3b1 Refactor bezier interpolation functions 2022-06-27 19:42:43 +02:00
reduz
7acf697479 Fix VECTOR/LOCAL transitions in Node3D
Fixes #62225, supersedes #62227
2022-06-27 13:45:35 +02:00
reduz
3d1ab570b9 Add surface indices to TriangleMesh
Helps unblock #56597
2022-06-22 21:48:23 +02:00
reduz
141c375581 Clean up Hash Functions
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)
2022-06-20 12:54:19 +02:00
Marcel Admiraal
d3f0994572 Ensure AudioFrame variables l and r are always initialised 2022-06-17 17:36:11 +01:00
Yuri Rubinsky
4be41a9a97 Remove redundand header from a_star.h 2022-06-16 17:23:08 +03:00
Yuri Rubinsky
7da2a21425 Make AStar to use 64-bit logic 2022-06-16 16:43:41 +03:00
Rémi Verschelde
1ad6fade00
Merge pull request #58669 from theraot/ASar2Dbidirectional
AStar2D bidirectional
2022-06-16 12:46:51 +02:00
Yuri Rubinsky
09418afbc0 Fix wrapf to correct wrap values with 0.1 stepping 2022-06-08 17:11:55 +03:00
Rémi Verschelde
c8ce7e34e2 i18n: Misc fixes translation strings
Adds some translator comments to solve some questions raised on Weblate.
2022-06-08 12:57:54 +02:00
Rémi Verschelde
5ebdfc31b2
Merge pull request #61319 from JFonS/taa_wip
Initial TAA implementation
2022-06-07 20:53:55 +02:00
K. S. Ernest (iFire) Lee
1b776a6e7a Allow picking similar colours using OKHSL. 2022-06-07 05:53:27 -07:00
jfons
ba832d83b2 Initial TAA implementation
Initial TAA support based on the implementation in Spartan Engine.

Motion vectors are correctly generated for camera and mesh movement, but there is no support for other things like particles or skeleton deformations.
2022-06-07 13:14:44 +02:00
reduz
45af29da80 Add a new HashSet template
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
2022-05-20 22:40:38 +02:00
Aaron Record
900c676b02 Use range iterators for RBSet in most cases 2022-05-19 12:09:16 +02:00
reduz
746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
Yuri Roubinsky
dbd7a31507 Implement exponential operator (**) to GDScript/Expressions 2022-05-11 16:30:37 +03:00
Rémi Verschelde
d8935b27a9 Fix warnings found by Emscripten 3.1.10
Fix `-Wunused-but-set-variable`, `-Wunqualified-std-cast-call`, and
`-Wliteral-range` warnings.
2022-05-10 13:03:13 +02:00
smix8
868fe4942c Allow AStar2D/AStar3D zero point weight
Allow AStar2D/AStar3D zero point weight.

Limit was set to 1 which seemed like an arbitrary value as lower values down to zero can be useful for common gameplay navigation elements like teleports.
2022-05-06 02:33:10 +02:00
Rémi Verschelde
e7a58a7eb6 Core: Rename math 'phi' arguments to 'angle' 2022-05-05 14:17:39 +02:00
Aaron Franke
fa7a7795f0
Rename Basis get_axis to get_column, remove redundant methods 2022-05-03 09:37:47 -05:00
Rémi Verschelde
931838b330
Merge pull request #60627 from aaronfranke/rename-elements
Rename Transform2D and Basis `elements` to `columns` and `rows` respectively
2022-05-03 14:40:01 +02:00
Rémi Verschelde
c273ddc3ee Style: Partially apply clang-tidy's cppcoreguidelines-pro-type-member-init
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.
2022-05-02 16:28:25 +02:00
Aaron Franke
1bf94dff3a
Rename Basis "elements" to "rows" 2022-04-29 08:02:56 -05:00
Aaron Franke
b831fb0a54
Rename Transform2D "elements" to "columns" 2022-04-29 08:02:39 -05:00
bruvzg
de4c97758a
Fix more issues found by cppcheck. 2022-04-20 10:34:00 +03:00
Rémi Verschelde
46ef52162e Color: Rename to_srgb/to_linear to include base color space
This helps reduce confusion around sRGB <> Linear conversions by making
both input and output color spaces explicit.
2022-04-13 11:45:52 +02:00
SaracenOne
8fbed3d582 Rearrange TriangleMesh stack level incrementation to fix MSVC compiler optimization bug 2022-04-13 05:48:49 +01:00
bruvzg
f851c4aa33
Fix some issues found by cppcheck. 2022-04-06 14:34:37 +03:00
Rémi Verschelde
099b024a2b Fix DynamicBVH crash after #59867
I made a wrong assumption that initialization the other pointer in the
union would properly initialize the `childs` array.
2022-04-05 02:17:34 +02:00
Rémi Verschelde
f8ab79e68a Zero initialize all pointer class and struct members
This prevents the pitfall of UB when checking if they have been
assigned something valid by comparing to nullptr.
2022-04-04 19:49:50 +02:00
lawnjelly
109d08c84a Add protective checks for invalid handle use in BVH
Adds DEV_ASSERTS that will halt at runtime if the BVH is misused with invalid IDs, and adds ERR_FAIL macros to prevent calling with invalid IDs.

Any such misuse is a bug in the physics, but this should flag any errors quickly.
2022-03-23 09:19:26 +00:00
Yuri Roubinsky
7913e04950 Rename AStar to AStar3D 2022-03-20 17:34:40 +03:00
Rémi Verschelde
5c4de463fe
Merge pull request #59229 from taigi100/Bugfix-#59215-Standard-color-name-returns-non-standard-color-code 2022-03-17 11:38:06 +01:00
taigi100
bd247fa315 Update color constants to use HEX codes 2022-03-17 11:36:23 +02:00
Silc 'Tokage' Renew
b06d253920 Fix blend animation to solve TRS track bug & blend order inconsistency 2022-03-16 05:11:55 +09:00
reduz
21637dfc25 Remove VARIANT_ARG* macros
* Very old macros from the time Godot was created.
* Limited arguments to 5 (then later changed to 8) in many places.
* They were replaced by C++11 Variadic Templates.
* Renamed methods that take argument pointers to have a "p" suffix. This was used in some places and not in others, so made it standard.
* Also added a dereference check for Variant*. Helped catch a couple of bugs.
2022-03-09 18:39:13 +01:00
Rémi Verschelde
4e3d5a9a2c VariantUtility: Unexpose Math::range_step_decimals
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.
2022-03-07 22:13:49 +01:00
lawnjelly
0565676893 Protection for array operator for Vector2 / 3 in DEV builds
A previous PR had changed the array operator to give unbounded access. This could cause crashes where old code depended on this previous safe behaviour.

This PR adds DEV_ASSERT macros for out of bound access to DEV builds, allowing us to quickly identify bugs in calling code, without affecting performance in release or release_debug editor builds.
2022-03-07 11:15:45 +00:00
Rémi Verschelde
0d1e3893d9
Merge pull request #57630 from lawnjelly/bvh4_templated_checks
[4.x] BVH - Sync BVH with 3.x
2022-03-04 23:29:38 +01:00
Theraot
3590cdfd34 Added missing p_bidirectional to AStar2D methods
The methods disconnect_points and are_points_connected  now have an optional p_bidirectional parameter matching AStar.
2022-03-01 17:01:32 -05:00
Rémi Verschelde
de9446186d
Merge pull request #58488 from lawnjelly/float_literals_casts 2022-03-01 01:32:07 +01:00
Aaron Franke
061ab30051
Use is_zero_approx and fix spelling in CameraMatrix invert 2022-02-26 12:19:54 -06:00
lawnjelly
1485924a2b Float literals - fix main primitives to use real_t casting
Uses (real_t) casting to ensure appropriate calculations are done in 32 bit where real_t is compiled as 32 bit.
2022-02-24 08:15:10 +00:00
Rémi Verschelde
e031aa06ee Core: Use forward declares for Vector3/Vector3i
Add add Vector3 operator in Vector3i.
2022-02-19 16:47:24 +01:00
Rémi Verschelde
b8b4580448
Style: Cleanup single-line blocks, semicolons, dead code
Remove currently unused implementation of TextureBasisU, could be re-added
later on if needed and ported.
2022-02-16 14:06:29 +01:00
Silc 'Tokage' Renew
865da09871 Implement cubic_interpolate() as MathFunc for refactoring 2022-02-12 18:11:17 +09:00
lawnjelly
5298e16e80 Float literals - fix main primitives to use .f
Converts float literals from double format (e.g. 0.0) to float format (e.g. 0.0f) where appropriate for 32 bit calculations.
2022-02-10 18:43:19 +00:00
Bartłomiej T. Listwon
51cac0709e Fix Vector2 and Vector2i coord access via operator[] 2022-02-09 09:17:17 +01:00
Rémi Verschelde
8aa4ed8b5b
Merge pull request #57729 from TechnoPorg/astar-fix-invalid-include
Remove a cross include from a_star.cpp
2022-02-07 00:35:42 +01:00
TechnoPorg
5108af42ad Remove a cross include from a_star.cpp 2022-02-06 15:05:17 -07:00
reduz
8c7268664d
Fix integer vector mul/div operators and bindings.
* Vector2i and Vector3i mul/div by a float results in Vector2 and Vector3 respectively.
* Create specializations to allow proper bindings.

This fixes #44408 and supersedes #44441 and keeps the same rule of int <op> float returnig float, like with scalars.
2022-02-06 13:34:41 +01:00
Rémi Verschelde
a0c87d4c11
Merge pull request #57620 from Haydoggo/expression-exp-fix
Fix Expression's parsing of positive exponent literals
2022-02-05 10:14:10 +01:00
Hayden
1305ff92f7 Make parser treat all exponent literals as float 2022-02-05 16:34:26 +13:00
Rémi Verschelde
84290fe4b1
Merge pull request #57623 from akien-mga/core-math-struct-em-all 2022-02-04 19:02:57 +01:00
lawnjelly
f8eaab5b47 BVH - Sync BVH with 3.x
Templated mask checks and generic NUM_TREES
Fix leaking leaves
2022-02-04 16:51:21 +00:00
Rémi Verschelde
5ddb518496
Core: Make all Variant math types structs
Some were declared as structs (public by default) and others as classes
(private by default) but in practice all these math types exposed as
Variants are all 100% public.
2022-02-04 16:48:24 +01:00
Rémi Verschelde
e223bad86d
Core: Move Vector2i to its own vector2i.h header
Also reduce interdependencies and clean up a bit.
2022-02-04 16:32:21 +01:00
Rémi Verschelde
5f56d385b0
Core: Move Rect2i to its own rect2i.h header
And take the opportunity to improve interdependencies a bit with forward
declares where possible.
2022-02-04 14:17:30 +01:00
bruvzg
244db37508
Cleanup and move char functions to the char_utils.h header. 2022-02-04 11:35:01 +02:00
Hayden Leete
018de19eba Added hex and bin literal support to Expression parser
fixed formatting
2022-02-04 10:49:19 +13:00
Anilforextra
fc27636999 Vectors: Use clear() and has().
Use clear() instead of resize(0).

Use has() instead of "find(p_val) != -1".
2022-02-02 00:11:09 +05:45
Rémi Verschelde
8c7cd904f5
Merge pull request #57469 from Sauermann/fix-rect2i-intersect 2022-02-01 00:05:02 +01:00
Markus Sauermann
23a4fe5b27 Fix incorrect Rect2i calculations: intersects and encloses
Clarify expand documentation
2022-01-31 19:03:57 +01:00
bruvzg
8e79c5fb8d
Add support for the escaped UTF-16 and UTF-32 Unicode characters in the scripts and expressions. 2022-01-30 20:16:04 +02:00
Omar Polo
bd448e5535 Rename or refactor macros to avoid leading underscores
These are not used consistently and some can conflict with
system-specific defines.  While here, also delete some unused macros.
2022-01-20 20:29:15 +01:00
lawnjelly
b411a731fe Add nodiscard to core math classes to catch c++ errors.
A common source of errors is to call functions (such as round()) expecting them to work in place, but them actually being designed only to return the processed value. Not using the return value in this case in indicative of a bug, and can be flagged as a warning by using the [[nodiscard]] attribute.
2022-01-20 13:07:49 +00:00
Aaron Franke
252c803d94
Remove zero size checks from Rect2 grow methods 2022-01-14 00:45:05 -06:00
Rémi Verschelde
dbab0a9487
Merge pull request #56740 from AnilBK/camera-pre-allocate 2022-01-13 11:13:31 +01:00
Anilforextra
8a9c9a67ef CameraMatrix: Pre-allocate Vector in get_projection_planes(). 2022-01-13 10:14:59 +05:45
Rémi Verschelde
585231a172
Merge pull request #56492 from akien-mga/remove-author-docstrings 2022-01-12 15:24:17 +01:00
Anilforextra
6c3a0460a8 Use List Initializations for Vectors. 2022-01-12 10:15:12 +05:45
Rémi Verschelde
e1766da4bd
Merge pull request #53618 from aaronfranke/signed-angle-vec3i
Add length and length_squared to Vector2i/3i
2022-01-07 01:14:29 +01:00
Rémi Verschelde
b008cb8df6
Merge pull request #55877 from aaronfranke/slerp-same-len 2022-01-07 00:44:26 +01:00
Rémi Verschelde
a01b18a476
Fix typos with codespell
Using codespell 2.1.0.

Method:
```
$ cat > ../godot-word-whitelist.txt << EOF
ang
ans
ba
curvelinear
dof
doubleclick
fave
findn
gird
inout
leapyear
lod
merchantibility
nd
numer
ois
ony
que
readded
seeked
statics
2022-01-07 00:12:09 +01:00
Aaron Franke
064036d786
Allow Vector2/3 slerp values to have any length 2022-01-06 11:12:59 -08:00
Aaron Franke
2c52f16464
Add length and length_squared to Vector2i/3i 2022-01-06 10:06:56 -08:00
Rémi Verschelde
6af77c7b09
Merge pull request #53684 from TokageItLab/orthogonal-mode 2022-01-05 16:05:40 +01:00
Rémi Verschelde
ba2bdc478b
Style: Remove inconsistently used @author docstrings
Each file in Godot has had multiple contributors who co-authored it over the
years, and the information of who was the original person to create that file
is not very relevant, especially when used so inconsistently.

`git blame` is a much better way to know who initially authored or later
modified a given chunk of code, and most IDEs now have good integration to
show this information.
2022-01-04 20:42:50 +01:00
Rémi Verschelde
fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
Silc 'Tokage' Renew
61759da5b3 Fix some gizmo behavior to make more consistent 2021-12-25 03:24:04 +09:00
great90
10c91f8116
Fix variable name 'max_size' to 'min_size' in aabb 2021-12-19 11:51:14 +08:00
Haoyu Qiu
1fb59d13c2 Fix font preview text color on light background 2021-12-18 00:34:28 +08:00
Nathan Franke
41a20171eb
align to horizontal_alignment, valign to vertical_alignment, related 2021-12-09 01:38:46 -06:00
Aaron Franke
24f57886d0
Expose max_axis_index and max_axis_index for Vector2(i)
Some cleanup with Vector3(i)'s methods so that it is consistent with Vector2, for example it returns enums internally (GDScript still gets ints).
2021-12-02 23:45:41 -06:00
Rémi Verschelde
892a5a72cd
Merge pull request #55474 from akien-mga/copy-operators-no-reference 2021-12-02 17:34:45 +01:00
Max Hilbrunner
837e6bdf18
Merge pull request #37626 from aaronfranke/rect2-warnings
Print warnings when using a Rect2 or AABB with a negative size
2021-12-02 14:41:02 +01:00
Rémi Verschelde
49d8925713
Merge pull request #47294 from sebastian-heinz/patch-1 2021-12-02 10:04:17 +01:00
Rémi Verschelde
02d6cbfd8c
Merge pull request #38604 from Calinou/astar-rename-get-point-ids 2021-12-02 09:35:57 +01:00
sebastian-heinz
be90aadbcd allow variant construction in expressions 2021-12-02 15:30:10 +08:00
Raul Santos
a367378f9e Rename Vector parameters to be consistent
Renames parameters that were named differently across different
scripting languages or their documentation to use the same name
everywhere.
2021-12-01 21:14:46 +01:00
Aaron Franke
9687f6fca3
Warn when using an AABB or Rect2 with a negative size 2021-11-30 18:27:58 -06:00
Hugo Locurcio
89849a9ed9
Rename AStar.get_points() to AStar.get_point_ids() for clarity
The same has been done for AStar2D as well.
2021-11-30 22:14:39 +01:00
Rémi Verschelde
7da392bcc5
Don't return reference on copy assignment operators
We prefer to prevent using chained assignment (`T a = b = c = T();`) as this
can lead to confusing code and subtle bugs.

According to https://en.wikipedia.org/wiki/Assignment_operator_(C%2B%2B), C++
allows any arbitrary return type, so this is standard compliant.

This could be re-assessed if/when we have an actual need for a behavior more
akin to that of the C++ STL, for now this PR simply changes a handful of
cases which were inconsistent with the rest of the codebase (`void` return
type was already the most common case prior to this commit).
2021-11-30 16:26:29 +01:00
Lightning_A
e078f970db Rename remove() to remove_at() when removing by index 2021-11-23 18:58:57 -07:00
Rémi Verschelde
2b24629847
Merge pull request #55042 from nekomatata/fix-segment-intersection 2021-11-17 17:33:56 +01:00
Yuri Roubinsky
a74acca858 Expose randfn to global scope 2021-11-17 14:29:19 +03:00
PouleyKetchoupp
6d0c93dccf Fix segment intersection in Geometry2D
Doing a multiplication to reduce the amount of tests was causing
precision which lead to 2D raycast detecting false positive contacts
in some cases with convex polygons.
2021-11-16 18:09:33 -07:00
Hugo Locurcio
8fb7e622a6
Rename built-in SGN() macro to SIGN()
This matches the name of the GDScript function (except it's uppercase
here).
2021-11-16 20:40:49 +01:00
Rémi Verschelde
d975b1bc37
Merge pull request #43072 from KoBeWi/point_to_angle 2021-11-15 09:56:21 +01:00
Rémi Verschelde
e2e9b08cc7
Color: Bind from_hsv as static method 2021-11-11 11:50:02 +01:00
Rémi Verschelde
06a33e590f
Merge pull request #53819 from TokageItLab/re-implement-ping-pong
Reimplement ping-pong animation and reverse playback
2021-11-09 22:11:04 +01:00
Tomasz Chabora
606cfa9a47 Fix Vector2.angle_to_point() being reversed 2021-11-09 16:59:58 +01:00
Brian Semrau
dc11e73bf0 Rename AABB get_area to get_volume 2021-11-05 18:22:42 -04:00
Aaron Franke
744b43b527
Fix Quaternion multiplication operator 2021-11-04 11:24:46 -05:00
Silc 'Tokage' Renew
953a7bce7e reimplement ping-pong 2021-11-03 13:39:33 +09:00
Rémi Verschelde
0ae65472e7
clang-format: Enable BreakBeforeTernaryOperators
clang-format keeps breaking the way it handles break *after* ternary operators,
so I give up and go with the only style they seem to actually test.
2021-10-28 15:57:41 +02:00
Rémi Verschelde
3a6be64c12
clang-format: Various fixes to comments alignment from clang-format 13
All reviewed manually and occasionally rewritten to avoid bad auto formatting.
2021-10-28 15:43:36 +02:00
Rémi Verschelde
3b11e33a09
clang-format: Disable alignment of operands, too unreliable
Sets `AlignOperands` to `DontAlign`.

`clang-format` developers seem to mostly care about space-based indentation and
every other version of clang-format breaks the bad mismatch of tabs and spaces
that it seems to use for operand alignment. So it's better without, so that it
respects our two-tabs `ContinuationIndentWidth`.
2021-10-28 15:19:35 +02:00
reduz
d03b7fbe09 Refactored Node3D rotation modes
* Made the Basis euler orders indexed via enum.
* Node3D has a new rotation_order property to choose Euler rotation order.
* Node3D has also a rotation_mode property to choose between Euler, Quaternion and Basis

Exposing these modes as well as the order makes Godot a lot friendlier for animators, which can choose the best way to interpolate rotations.
The new *Basis* mode makes the (exposed) transform property obsolete, so it was removed (can still be accessed by code of course).
2021-10-25 14:34:00 -03:00
Rémi Verschelde
24fdedfe94
Merge pull request #54050 from reduz/animation-compression 2021-10-25 14:27:58 +02:00
reduz
a69541da4c Implement Animation Compression
Roughly based on https://github.com/godotengine/godot-proposals/issues/3375 (used format is slightly different).

* Implement bitwidth based animation compression (see animation.h for format).
* Can compress imported animations up to 10 times.
* Compression format opens the door to streaming.
* Works transparently (happens all inside animation.h)
2021-10-21 18:27:34 -03:00
Marcel Admiraal
87a4ba492e Remove unimplemented methods 2021-10-21 18:44:25 +01:00
mennomax
b4eeeb315a
Swap args of Plane(point, normal) constructor
Now (normal, point)
2021-10-15 20:49:42 -05:00