Commit graph

840 commits

Author SHA1 Message Date
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