Commit Graph

1028 Commits

Author SHA1 Message Date
cda723d201 Color: Fix resetting alpha when setting H/S/V separately
Fixes #63487.
2022-07-26 15:43:49 +02:00
7006f7d693 Add some missing Vector4 methods 2022-07-26 02:35:42 +02:00
4b13a6dcb8 add equal checks to Transform3D::looking_at and Transform3D::set_look_at 2022-07-25 13:39:40 -05:00
178405f7cb Fixup BVH debugging statements 2022-07-25 18:21:53 +02:00
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
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
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
ccc56cc6d4 Rename epsilon to tolerance in the Plane::has_point method 2022-07-21 20:15:15 +03:00
db7c91e0ad Fix the calculation of the angular velocity when the rotation speed is not high. 2022-07-19 10:27:13 +02:00
2bf9e6090c rename translate(d) to translate(d)_local in Transform 2D/3D 2022-07-16 11:47:54 +02:00
1f69666209 Remove Octree
Octree is no longer used in 4.x.
2022-07-06 14:10:05 +01:00
0ccde38668 Expression built-in functions can also be considered as identifiers in subscripts 2022-07-04 13:25:43 +03:00
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
25baa32db0 Merge pull request #62458 from Geometror/interpolation-function-cleanup
Refactor Bezier interpolation functions
2022-06-27 23:25:33 +02:00
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
99ce0df3b1 Refactor bezier interpolation functions 2022-06-27 19:42:43 +02:00
7acf697479 Fix VECTOR/LOCAL transitions in Node3D
Fixes #62225, supersedes #62227
2022-06-27 13:45:35 +02:00
3d1ab570b9 Add surface indices to TriangleMesh
Helps unblock #56597
2022-06-22 21:48:23 +02:00
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
d3f0994572 Ensure AudioFrame variables l and r are always initialised 2022-06-17 17:36:11 +01:00
4be41a9a97 Remove redundand header from a_star.h 2022-06-16 17:23:08 +03:00
7da2a21425 Make AStar to use 64-bit logic 2022-06-16 16:43:41 +03:00
1ad6fade00 Merge pull request #58669 from theraot/ASar2Dbidirectional
AStar2D bidirectional
2022-06-16 12:46:51 +02:00
09418afbc0 Fix wrapf to correct wrap values with 0.1 stepping 2022-06-08 17:11:55 +03:00
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
5ebdfc31b2 Merge pull request #61319 from JFonS/taa_wip
Initial TAA implementation
2022-06-07 20:53:55 +02:00
1b776a6e7a Allow picking similar colours using OKHSL. 2022-06-07 05:53:27 -07:00
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
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
900c676b02 Use range iterators for RBSet in most cases 2022-05-19 12:09:16 +02:00
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
dbd7a31507 Implement exponential operator (**) to GDScript/Expressions 2022-05-11 16:30:37 +03:00
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
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
e7a58a7eb6 Core: Rename math 'phi' arguments to 'angle' 2022-05-05 14:17:39 +02:00
fa7a7795f0 Rename Basis get_axis to get_column, remove redundant methods 2022-05-03 09:37:47 -05:00
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
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
1bf94dff3a Rename Basis "elements" to "rows" 2022-04-29 08:02:56 -05:00
b831fb0a54 Rename Transform2D "elements" to "columns" 2022-04-29 08:02:39 -05:00
de4c97758a Fix more issues found by cppcheck. 2022-04-20 10:34:00 +03:00
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
8fbed3d582 Rearrange TriangleMesh stack level incrementation to fix MSVC compiler optimization bug 2022-04-13 05:48:49 +01:00
f851c4aa33 Fix some issues found by cppcheck. 2022-04-06 14:34:37 +03:00
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
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
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
7913e04950 Rename AStar to AStar3D 2022-03-20 17:34:40 +03:00
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
bd247fa315 Update color constants to use HEX codes 2022-03-17 11:36:23 +02:00