summaryrefslogtreecommitdiff
path: root/scene/2d/path_2d.cpp
AgeCommit message (Collapse)Author
2023-01-05One Copyright Update to rule them allRémi Verschelde
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".
2022-12-06Fix Path2D fish bone directionYaohua Xiong
2022-12-06Path2D: Fix build issue after conflicts between #68860 and #69115Rémi Verschelde
2022-12-06Merge pull request #68860 from xiongyaohua/path3d_fishbonesRémi Verschelde
Draw fish bones for Path3D and Path2D in the Editor
2022-12-05Refactor baking code for Curve2DYaohua Xiong
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-05draw fish bones for Path2D and Path3DYaohua Xiong
These fish bones are add to indicate the direction and local transforms alone the path.
2022-11-01Move rotation sampling from Path2D to Curve2DYaohua Xiong
The rotation sampling code is moved from Path2D to a new method `sample_baked_with_rotation` on Curve2D.
2022-09-19Change return type of `get_configuration_warnings` to `PackedStringArray`Marc Gilleron
2022-09-02Rename `or_lesser` range property hint to `or_less`Hugo Locurcio
"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-08-30Rename Curve/Curve2D/Curve3D/Gradient `interpolate()` to `sample()`Hugo Locurcio
"sampling" is a more accurate term than "interpolating" for what's happening when using that function.
2022-08-29Rename `CanvasItem.update()` to `queue_redraw()`Micky
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-24Rename PathFollow's `offset`s to `progress` & `progress_ratio`Micky
Applies for both PathFollow2D and PathFollow3D
2022-08-22Make `_validate_property` a multilevel methodYuri Sizov
2022-07-14prevent crash on NaN offset in path_follower 2d and 3dHayden Leete
2022-06-20Add Path2D/3D debug optionssmix8
Add Path2D/3D debug options.
2022-05-19Use suffixes for units in nodes and resourcesAaron Franke
2022-04-17PathFollow2D and PathFollow3D: don't set offset to NaNRicardo Buring
2022-03-28String: Remove TTR and DTR defines in non-tools buildRémi Verschelde
This ensures we don't use TTR in runtime code, as it's specifically meant to source translations for the editor.
2022-02-15Use `switch` consistently in `_notification` (`scene` folder)Rémi Verschelde
2022-01-09Path2D: Check points count before rendering.Anilforextra
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-12-01Faster Path2D drawing with polylinelawnjelly
Changes the Path2D drawing to use POLYLINE instead of thick lines.
2021-08-13Fix some unnecessary includesAaron Franke
2021-04-11Use Array for node configuration warningsNathan Franke
Previously, the warnings were passed as a string and delimitation of which were hard coded at each implementation.
2021-03-19Use real_t in non-physics 2D nodesAaron Franke
2021-02-10Removed _change_notifyreduz
-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-07Initialize class variables with default values in scene/ [1/2]Rafał Mikrut
2021-01-01Update copyright statements to 2021Rémi Verschelde
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 🎆
2020-12-28Merge pull request #44149 from madmiraal/rename-tangent-orthogonalRémi Verschelde
Rename Vector2.tangent() to Vector2.orthogonal()
2020-12-28Rename empty() to is_empty()Marcel Admiraal
2020-12-11Move initialization of some classes to headersTomasz Chabora
2020-12-06Rename Vector2.tangent() to Vector2.orthogonal()Marcel Admiraal
2020-12-04Rename PathFollow2D rotate boolAaron Franke
2020-11-07Reorganized core/ directory, it was too fatty alreadyreduz
-Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
2020-10-01Merge pull request #38743 from arrowinaknee/node-config-warningsRémi Verschelde
Update all get_configuration_warning() to retrieve warnings from the parent
2020-06-12Object: Add usage hint to instantiate Object properties in editorRémi Verschelde
Fixes #36372 as Path2D/Path3D's `curve` property no longer uses a Curve instance as default value, but instead it gets a (unique) default Curve instance when created through the editor (CreateDialog). ClassDB gets a sanity check to ensure that we don't do the same mistake for other properties in the future, but instead use the dedicated property usage hint. Fixes #36372. Fixes #36650. Supersedes #36644 and #36656. Co-authored-by: Thakee Nathees <thakeenathees@gmail.com> Co-authored-by: simpuid <utkarsh.email@yahoo.com>
2020-05-27Split `Geometry` singleton into `Geometry2D` and `Geometry3D`Andrii Doroshenko (Xrayez)
Extra `_2d` suffixes are removed from 2D methods accoringly.
2020-05-16Update all get_configuration_warning to retrieve warnings from the parentArrowInAKnee
2020-05-14Style: Enforce braces around if blocks and loopsRémi Verschelde
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
2020-04-27Merge pull request #36035 from Xrayez/path2d-fix-self-modulateRémi Verschelde
Do not override Path2D.self_modulate property
2020-04-13Handle huge offset values in Path2D and Path3D set_offsetMickeMakaron
2020-04-02Replace NULL with nullptrlupoDharkael
2020-02-28Signals: Port connect calls to use callable_mpRémi Verschelde
Remove now unnecessary bindings of signal callbacks in the public API. There might be some false positives that need rebinding if they were meant to be public. No regular expressions were harmed in the making of this commit. (Nah, just kidding.)
2020-02-25Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.Juan Linietsky
- Renames PackedIntArray to PackedInt32Array. - Renames PackedFloatArray to PackedFloat32Array. - Adds PackedInt64Array and PackedFloat64Array. - Renames Variant::REAL to Variant::FLOAT for consistency. Packed arrays are for storing large amount of data and creating stuff like meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of memory. That said, many users requested the ability to have 64 bits packed arrays for their games, so this is just an optional added type. For Variant, the float datatype is always 64 bits, and exposed as `float`. We still have `real_t` which is the datatype that can change from 32 to 64 bits depending on a compile flag (not entirely working right now, but that's the idea). It affects math related datatypes and code only. Neither Variant nor PackedArray make use of real_t, which is only intended for math precision, so the term is removed from there to keep only float.
2020-02-20Reworked signal connection system, added support for Callable and Signal ↵Juan Linietsky
objects and made them default.
2020-02-11Bugfixes and ability to better specify filter and repeat modes everywhere.Juan Linietsky
Removes antialiased flag for draw_* methods.
2020-02-09Do not override Path2D.self_modulate propertyAndrii Doroshenko (Xrayez)
Self-modulation was forcefully used for the curve drawing which can interfere with scripted drawing. The curve color is specified by the `draw_line()` method instead.
2020-02-03Updates Path2D in debugging if navigation is visibleHaoyu Qiu
2020-01-24Allow greater values in unit_offsetTomasz Chabora