Commit Graph

118 Commits

Author SHA1 Message Date
8ba4656ea3 Compile out editor-only logic within validate_property in games 2025-06-12 12:54:19 +08:00
e64fe63f17 Improve Path2D debug performance
Improves Path2D node debug performance by changing the debug to use mesh and multimesh instead of slower canvas draw functions.
2025-06-09 17:25:06 +02:00
ad40939b6f Core: Replace C math headers with C++ equivalents
- Minor restructuring to ensure `math_funcs.h` is the central point for math functions
2025-04-16 15:49:02 -05:00
c1acc839a8 Directly use segment points in Geometry2D/3D function parameters 2025-03-30 16:25:59 -07:00
13a1391e73 Draw fewer fishbones to improve Path gizmo readability and performance
This affects both Path2D and Path3D.
2025-01-09 16:08:29 +01:00
a1846b27ea Improve use of Ref.is_null/valid
Use `is_null` over `!is_valid` and vice versa.
2024-12-23 16:35:02 -05:00
58e79bfa9a Compile certain CanvasItem._edit_*() functions with DEBUG_ENABLED 2024-11-02 15:43:18 -03:00
66d19abdfa Merge pull request #96629 from ditiem-games/path2d
Fix Animated Path2D doesn't update PathFollow2D progress when scene is running.
2024-10-21 16:39:28 -05:00
1b376b32cd Update FollowPath2D children of Path2D when a curve_changed event occurs 2024-09-06 07:54:22 +08:00
9dc231366d Fix super call in various get_configuration_warnings methods 2024-09-05 16:08:35 +02:00
ea9dff87ae Add error checks for bad configuration in PathFollow2D/3D set_progress_ratio
When a PathFollow is badly configured it's possible to have code that
call get_progress_ratio just after set_progress_ratio does not return
the value just set, which may be confusing for developer (ie that
    myPathFollow2D.set_progress_ratio(0.5)
    myPathFollow2D.get_progress_ratio()
does not return 0.5)

This commit makes ensures the developer has useful error messages in
such case, to make it easier to troubleshot it.
2024-09-04 18:07:49 +02:00
21f0529aa9 Revert "Update Node::get_configuration_warnings signature"
This reverts commit d3852deaa4.
2024-02-17 19:03:21 +01:00
d3852deaa4 Update Node::get_configuration_warnings signature 2024-02-08 23:05:20 +01:00
95b27fe8c7 Reorganize code related to editor theming
This change introduces a new EditorThemeManager class
to abstract theme generatio and its subroutines.

Logic related to EditorTheme, EditorColorMap, and editor
icons has been extracted into their respective files with
includes cleaned up.

All related files have been moved to a separate folder to
better scope them in the project. This includes relevant
generated files as well.
2024-01-16 11:57:45 +01:00
acae382010 Changed the way the rotation of a curve at a point is evaluated to match PathFollow2D 2023-10-28 01:23:38 -05:00
de4a3fa151 Unify and streamline connecting to Resource changes 2023-07-17 19:35:57 +02:00
42aa5398d9 Fix Pathfollow direction
Co-authored-by: aaronfranke <arnfranke@yahoo.com>
2023-05-24 17:37:00 +09:00
5d75edb3b5 Update PathFollow2D when curve is changed 2023-01-15 18:11:21 +01:00
d95794ec8a One Copyright Update to rule them all
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".
2023-01-05 13:25:55 +01:00
322dbd0955 Fix Path2D fish bone direction 2022-12-06 20:45:17 +08:00
deb760fb1b Path2D: Fix build issue after conflicts between #68860 and #69115 2022-12-06 11:22:11 +01:00
14861c45b5 Merge pull request #68860 from xiongyaohua/path3d_fishbones
Draw fish bones for Path3D and Path2D in the Editor
2022-12-06 10:46:54 +01:00
91e9ad92f5 Refactor baking code for Curve2D
The main change is to caculate tangent directly from bezier curve, without going
through discretized polyline, avoiding pitfalls of discretization. A similar refacor
had been applied to Curve3D.

The test cases for Curve2D is updated, comparing floating point with is_equal_approxmiate()
instead of `==`, in order to avoid float precision problem.
2022-12-05 21:22:05 +08:00
9bdc0cb16f draw fish bones for Path2D and Path3D
These fish bones are add to indicate the direction and local transforms alone the path.
2022-12-05 15:39:14 +08:00
399c2a8dea Move rotation sampling from Path2D to Curve2D
The rotation sampling code is moved from Path2D to a new method
`sample_baked_with_rotation` on Curve2D.
2022-11-01 13:18:52 +08:00
aed3822a93 Change return type of get_configuration_warnings to PackedStringArray 2022-09-19 16:43:15 +01:00
f7292dbeb3 Rename or_lesser range property hint to or_less
"less" should be used for quantity, rather than "lesser".

Existing scripts that use `or_lesser` in `_get_property_list()`
will need to be updated to account for this change.
2022-09-02 19:08:20 +02:00
ae18928748 Rename Curve/Curve2D/Curve3D/Gradient interpolate() to sample()
"sampling" is a more accurate term than "interpolating" for what's
happening when using that function.
2022-08-30 22:08:38 +02:00
e31bb5ffeb Rename CanvasItem.update() to queue_redraw()
Affects a lot of classes. Very thoroughly checked signal connections and deferred calls to this method, add_do_method/add_undo_method calls, and so on.

Also renames the internal `_update_callback()` to `_redraw_callback()` for consistency.

Just a few comments have also been changed to say "redraw".

In CPUParticles2D, there was a private variable with the same name. It has been renamed to `do_redraw`.
2022-08-29 14:59:47 +02:00
bb936b2e27 Rename PathFollow's offsets to progress & progress_ratio
Applies for both PathFollow2D and PathFollow3D
2022-08-24 01:56:03 +02:00
1a24c9e14b Make _validate_property a multilevel method 2022-08-22 18:35:11 +03:00
fded50fced prevent crash on NaN offset in path_follower 2d and 3d 2022-07-14 14:15:02 +12:00
e12e239ab4 Add Path2D/3D debug options
Add Path2D/3D debug options.
2022-06-20 17:32:05 +02:00
5dc3bfb80e Use suffixes for units in nodes and resources 2022-05-19 14:34:27 -05:00
eb9157df23 PathFollow2D and PathFollow3D: don't set offset to NaN 2022-04-17 17:26:05 +02:00
7119d355eb String: Remove TTR and DTR defines in non-tools build
This ensures we don't use TTR in runtime code, as it's specifically meant
to source translations for the editor.
2022-03-28 20:26:35 +02:00
0f5455230c Use switch consistently in _notification (scene folder) 2022-02-15 18:44:55 +01:00
b770a4d0ac Path2D: Check points count before rendering. 2022-01-09 15:17:41 +05:45
fe52458154 Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
6db29583f2 Faster Path2D drawing with polyline
Changes the Path2D drawing to use POLYLINE instead of thick lines.
2021-12-01 15:23:27 +00:00
eb4902a455 Fix some unnecessary includes 2021-08-13 00:27:38 -05:00
2a8c59c171 Use Array for node configuration warnings
Previously, the warnings were passed as a string and delimitation of which were hard coded at each implementation.
2021-04-11 23:25:38 -05:00
6811a45b59 Use real_t in non-physics 2D nodes 2021-03-19 13:04:45 -04:00
1aa2823fa3 Removed _change_notify
-For inspector refresh, the inspector now detects if a property change by polling a few times per second and then does update the control if so. This process is very cheap.
-For property list refresh, a new signal (property_list_changed) was added to Object. _change_notify() is replaced by notify_property_list_changed()
-Changed all objects using the old method to the signal, or just deleted the calls to _change_notify(<property>) since they are unnecesary now.
2021-02-10 19:31:24 -03:00
003bb8e1a8 Initialize class variables with default values in scene/ [1/2] 2021-02-07 22:29:31 +01:00
b5334d14f7 Update copyright statements to 2021
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 🎆
2021-01-01 20:19:21 +01:00
058f3fe069 Merge pull request #44149 from madmiraal/rename-tangent-orthogonal
Rename Vector2.tangent() to Vector2.orthogonal()
2020-12-28 16:00:12 +01:00
5b937d493f Rename empty() to is_empty() 2020-12-28 10:39:56 +00:00
31cb04fbdd Move initialization of some classes to headers 2020-12-11 18:20:03 +01:00
a24c38d1a8 Rename Vector2.tangent() to Vector2.orthogonal() 2020-12-06 18:16:06 +00:00