summaryrefslogtreecommitdiffstats
path: root/scene/resources/curve.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit godotengine/godot@fd4c29a189e53a1e085df5b9b9a05cac9351b3efSpartan3222024-11-191-0/+4
|\
| * Implement closed path for Curve3dmatricola7872024-11-161-0/+4
| |
* | Fix copyright headers referring to GodotSpartan3222024-10-271-2/+2
| |
* | Rebrand preambles to RedotDubhghlas McLaughlin2024-10-111-0/+2
|/ | | | | | | | | | | | | | | | | | | | | | Credits: Co-authored-by: Skogi <skogi.b@gmail.com> Co-authored-by: Spartan322 <Megacake1234@gmail.com> Co-authored-by: swashberry <swashdev@pm.me> Co-authored-by: Christoffer Sundbom <christoffer_karlsson@live.se> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: McDubh <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: radenthefolf <radenthefolf@gmail.com> Co-authored-by: John Knight <80524176+Tekisasu-JohnK@users.noreply.github.com> Co-authored-by: Adam Vondersaar <adam.vondersaar@uphold.com> Co-authored-by: decryptedchaos <nixgod@gmail.com> Co-authored-by: zaftnotameni <122100803+zaftnotameni@users.noreply.github.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: wesam <108880473+wesamdev@users.noreply.github.com> Co-authored-by: Mister Puma <MisterPuma80@gmail.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: SingleError <isaaconeoneone@gmail.com> Co-authored-by: Bioblaze Payne <BioblazePayne@gmail.com>
* Support “clear points” function in Path3D editorjsjtxietian2024-03-271-0/+1
|
* Add a button to clear curve points in the Path2D editorAttackButton2023-10-031-0/+1
|
* Add handles to control Curve3D tiltDaniel Roberts2023-08-121-0/+10
|
* Overhaul the Curve EditorVolTer2023-05-281-0/+7
|
* One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
| | | | | | | | | | | | | | | | | | | | 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".
* Handle corner cases for curve bakingYaohua Xiong2022-12-141-0/+2
| | | | | | When control point and point have equal position, the derivative is 0 vector, which cause error message in Basis::look_at(). This commit handles this case.
* Refactor baking code for Curve2DYaohua Xiong2022-12-051-1/+14
| | | | | | | | | 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.
* Refactor Curve3D::_bake() methodYaohua Xiong2022-11-241-1/+6
| | | | | | | | | | The main change is to caculate tangent directly from bezier curve, without going through discretized polyline, avoiding pitfalls of discretization. Other changes are: 1. Add an bezier_derivative() method for Vector3, Vector2, and Math; 2. Add an tesselate_even_length() method to Curve3D, which tesselate bezier curve to even length segments adaptively; 3. Cache the tangent vectors in baked_tangent_vector_cache;
* Refactor Curv3D and PathFollow3DYaohua Xiong2022-11-121-6/+11
| | | | | | | | | | This commit makes the following major changes 1. Add "sample_baked_with_rotation()" to Curve3D, making it usable independently. A similar change was made to Curve2D previously. 2. Refactor the _bake() method on Curve3D, using Parallel Transport Frame instead of Frenet Frame. 3. Refactor the sample_* methods, including: i. Factor out common binary search code, following the DRY principe ii. sample_up_vector() interpolated up vector as part of rotation frame(posture) for consistancy and accuracy.
* Move rotation sampling from Path2D to Curve2DYaohua Xiong2022-11-011-0/+1
| | | | | The rotation sampling code is moved from Path2D to a new method `sample_baked_with_rotation` on Curve2D.
* Rename Curve/Curve2D/Curve3D/Gradient `interpolate()` to `sample()`Hugo Locurcio2022-08-301-11/+11
| | | | | "sampling" is a more accurate term than "interpolating" for what's happening when using that function.
* Fix Curve{2D,3D} notifying property list changedRaul Santos2022-06-231-0/+6
| | | | | | Make `Curve2D` and `Curve3D` more consistent with `Curve` and avoid calling `notify_property_list_changed` when the list of points doesn't change.
* Fixed dragging curve pointsVitika92022-06-221-1/+6
|
* Expose Curve points in the inspectorRaul Santos2022-05-171-0/+16
| | | | Exposes the Curve, Curve2D and Curve3D points as an array property.
* Implement `mark_dirty` in Curve2D and Curve3DRaul Santos2022-05-171-0/+4
| | | | | | Implements a method `mark_dirty` in Curve2D and Curve3D like the one that already exists in Curve, it's a convenient way to set `baked_cache_dirty` to `true` and also emit the `changed` signal.
* Regression: Fix Curve2D/Curve3D bakingHendrik Brucker2022-05-161-2/+2
|
* Replace most uses of Map by HashMapreduz2022-05-161-2/+2
| | | | | | | | | | | | * 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!
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Improve Curve with const and real_tAaron Franke2021-11-301-60/+60
|
* Curve2D/Curve3D: exact linear interpolationJihyun Yu2021-08-211-0/+2
| | | | | | | | | | While calculating interpolated points, intervals between two baked points has been assummed to be `baked_interval`. The assumption could cause significant error in some extreme cases (for example #7088). To improve accuracy, `baked_dist_cache` is introduced, which stores distance from starting point for each baked points. `interpolate_baked` now returns exact linear-interpolated position along baked points.
* Some work on double supportAaron Franke2021-08-091-2/+2
|
* Implement Particle Trailsreduz2021-04-301-1/+1
| | | | | | | | | -Enable the trails and set the length in seconds -Provide a mesh with a skeleton and a skin -Or, alternatively use one of the built-in TubeTrailMesh/RibbonTrailMesh -Works deterministically -Fixed particle collisions (were broken) -Not working in 2D yet (that will happen next)
* Initialize class variables with default values in scene/ [2/2]Rafał Mikrut2021-02-091-27/+21
|
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | 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 🎆
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-1/+1
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-7/+0
| | | | | | | | | | | | | | 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.
* Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.Juan Linietsky2020-02-251-2/+2
| | | | | | | | | | | | | | | | | | | | | - 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.
* PoolVector is gone, replaced by VectorJuan Linietsky2020-02-181-10/+10
| | | | | Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Curve: Prevent forcing 1.0 min value to 0.99Rémi Verschelde2019-06-211-0/+1
| | | | | | | | | | | The setters are called when the property is first initialized, and before that its default min and max are 0.0 and 1.0 respectively. If you configured min_value to 1.0 and max_value to e.g. 3.0, since the min_value setter can be called before that of max_value (which thus still defaults to 1.0), the min will be set to 0.99. Same conflict could happen with a configured max_value of 0 if its setter is called before that of a valid, negative min value.
* Made use of semicolons more consitent, fixed formattingJohnJLight2019-06-191-1/+2
|
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-1/+1
| | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
* Support for CPU based particles, which aids compatibility with OpenGL ES 2.0Juan Linietsky2018-07-061-0/+2
|
* Up vector implementation and OrientedPathFollow.danilo22052018-05-201-0/+6
|
* Added methods get_closest_point and get_closest_offset to both Curve2D and ↵danilo22052018-05-011-0/+4
| | | | Curve3D
* Add missing copyright headers and fix formattingRémi Verschelde2018-01-051-0/+1
| | | | | | Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
* Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Rename pos to position in user facing methods and variablesletheed2017-09-201-5/+5
| | | | | | | | | | | Rename user facing methods and variables as well as the corresponding C++ methods according to the folloming changes: * pos -> position * rot -> rotation * loc -> location C++ variables are left as is.
* Dead code tells no talesRémi Verschelde2017-08-271-50/+0
|
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|
* Synchronize parameter names in definition and declarationTwistedTwigleg2017-08-161-3/+3
| | | | Fixes #10244.
* Add object type hint for docsPoommetee Ketson2017-07-191-2/+2
|
* Fix curve saving, refined undo/redoMarc Gilleron2017-06-281-11/+19
|
* Curve featuresMarc Gilleron2017-06-261-0/+31
| | | | | | - Ability to set tangents as linear - Indicative min and max values - CurveTexture doesn't need min and max anymore
* Added Curve resourceMarc Gilleron2017-06-241-0/+72
| | | | | | - New resource for curves in y(x) form - CurveTexture now has a Curve - Curve and CurveTexture share the same editor