summaryrefslogtreecommitdiffstats
path: root/modules/csg/csg.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Enable shadow warnings and fix raised errorsNinni Pipping2023-05-111-18/+18
|
* Fix infinite loop in Build2DFaces::_find_edge_intersectionsJustin Wash2023-04-271-5/+22
|
* Fix CSG edge case causing intersection line to hit on common edge of 2 ↵K. S. Ernest (iFire) Lee2023-04-271-14/+66
| | | | | | | | | | | | | | | | | | | | triangles. The previous implementation assumed that the intersection entered or exited a shape when it hit right on the common edge of 2 triangles. However, there is also a case where it just "skirts" the other shape on the outside. To fix this, we added code to check the intersection distance and if the normals of the faces are pointed in the same direction as the intersection or not (e.g. inner product > 0). This handles the case where the intersection line hits the common edge of 2 triangles and skirts the other shape on the outside. Extended code to cover a third case. Fixes #58637. Co-authored-by: OldBelge <StevenGeens@users.noreply.github.com>
* 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".
* Fix some array size function definition mismatch.Fabio Alessandrelli2022-08-041-1/+1
|
* Replace most uses of Map by HashMapreduz2022-05-161-3/+3
| | | | | | | | | | | | * 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!
* Fix warnings found by Emscripten 3.1.10Rémi Verschelde2022-05-101-4/+3
| | | | | Fix `-Wunused-but-set-variable`, `-Wunqualified-std-cast-call`, and `-Wliteral-range` warnings.
* Rename `CSGPrimitive3D.invert_faces` to `flip_faces`hoontee2022-05-061-3/+3
|
* Rename Basis get_axis to get_column, remove redundant methodsAaron Franke2022-05-031-3/+3
|
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Rename `remove()` to `remove_at()` when removing by indexLightning_A2021-11-231-8/+8
|
* clang-format: Disable alignment of operands, too unreliableRémi Verschelde2021-10-281-2/+2
| | | | | | | | | Sets `AlignOperands` to `DontAlign`. `clang-format` developers seem to mostly care about space-based indentation and every other version of clang-format breaks the bad mismatch of tabs and spaces that it seems to use for operand alignment. So it's better without, so that it respects our two-tabs `ContinuationIndentWidth`.
* Fixed a typo in csg moduleM. Huri2021-10-121-1/+1
|
* Use range iterators for `Map`Lightning_A2021-09-301-4/+4
|
* Use functions defined in the their classes.Anilforextra2021-09-291-13/+13
|
* Fix Typo: Segement.Anilforextra2021-09-271-9/+9
|
* Add Get Center Method for Rect2/Rect2i and AABB.Anilforextra2021-09-211-2/+2
|
* Use C++ iterators for Lists in many situationsAaron Franke2021-07-231-2/+2
|
* Use is_equal_approx in more placesAaron Franke2021-07-211-5/+5
|
* Rename Transform to Transform3D in coreAaron Franke2021-06-031-1/+1
|
* Rename Array.invert() to Array.reverse()Marcel Admiraal2021-03-211-1/+1
| | | | | Does the same internally for List and Vector<>, which includes all PackedArray types.
* Fixes small typos and grammar correctionAnshul7sp12021-03-121-5/+5
|
* 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
* Don't attempt to insert points into degenerate triangles.Marcel Admiraal2020-08-131-5/+15
| | | | Use a simpler degenerate triangle check that calculates area.
* Mark the first shape as inside, not the second shape, when CSG shapes areMarcel Admiraal2020-08-121-2/+2
| | | | co-planer.
* Use is_equal_approx() instead of vertex_snap when checking if ray isMarcel Admiraal2020-06-291-1/+1
| | | | colliding with equiplanar CSG faces.
* Create degenerate triangles when inserting an edge into a CSG face.Marcel Admiraal2020-06-291-9/+0
| | | | | They will be deleted when the faces are merged, but their edges are needed for merging faces.
* Check if point's index exists before adding it to the list of pointsMarcel Admiraal2020-06-211-2/+6
| | | | | that need to split faces when avoiding creating degenerate faces while merging CSG faces.
* Split `Geometry` singleton into `Geometry2D` and `Geometry3D`Andrii Doroshenko (Xrayez)2020-05-271-7/+7
| | | | Extra `_2d` suffixes are removed from 2D methods accoringly.
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-60/+113
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-69/+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.
* Style: clang-format: Disable AllowShortIfStatementsOnASingleLineRémi Verschelde2020-05-101-15/+30
| | | | | | | Part of #33027, also discussed in #29848. Enforcing the use of brackets even on single line statements would be preferred, but `clang-format` doesn't have this functionality yet.
* [Core] Rename linear_interpolate to lerpAaron Franke2020-04-291-1/+1
|
* Style: Set clang-format Standard to Cpp11Rémi Verschelde2020-03-171-1/+1
| | | | | | | | | | For us, it practically only changes the fact that `A<A<int>>` is now used instead of the C++03 compatible `A<A<int> >`. Note: clang-format 10+ changed the `Standard` arguments to fully specified `c++11`, `c++14`, etc. versions, but we can't use `c++17` now if we want to preserve compatibility with clang-format 8 and 9. `Cpp11` is still supported as deprecated alias for `Latest`.
* Fix various typosluz.paz2020-03-111-3/+3
| | | Found via `codespell`
* Fix multiple issues with CSG module.Marcel Admiraal2020-02-211-1081/+1036
| | | | | | | | | | | - Replaces BuildPoly with Build2DFaces, which creates faces as each pair of face intersections are processed, instead of trying to create them after all the intersections are processed. Ensures that faces are merged when possible, and removes degenerate triangles. - Treats the child as inside the parent when faces are coplanar. - General clean up of csg.h and csg.cpp.
* PoolVector is gone, replaced by VectorJuan Linietsky2020-02-181-6/+6
| | | | | 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.
* Replace vector == and is_zero_approx(distance) with is_equal_approxAaron Franke2019-10-141-5/+5
| | | | Internal changes only
* Fix misc. source comment typosluz.paz2019-09-191-1/+1
| | | Found using `codespell -q 3 -S ./thirdparty,*.po -L ang,ba,cas,dof,doubleclick,fave,hist,leapyear,lod,nd,numer,ois,paket,seeked,sinc,switchs,te,uint -D ~/Projects/codespell/codespell_lib/data/dictionary.txt `
* Replace is_zero_approx(A.distance_to(B)) with A==BPaul Trojahn2019-08-191-5/+5
| | | | | Related to #22988 (Fixes the holes in the shape of the first comment)
* Merge pull request #29283 from qarmin/fix_some_always_same_valuesRémi Verschelde2019-06-201-4/+4
|\ | | | | Remove always true/false values
| * Fix always true/false valuesqarmin2019-06-201-4/+4
| |
* | Fix error macro calls not ending with semicolonRémi Verschelde2019-06-111-1/+1
|/ | | | | | | It's not necessary, but the vast majority of calls of error macros do have an ending semicolon, so it's best to be consistent. Most WARN_DEPRECATED calls did *not* have a semicolon, but there's no reason for them to be treated differently.
* Fix typos with codespellRémi Verschelde2019-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using codespell 1.15.0. Method: ``` $ cat > ../godot-word-whitelist.txt << EOF ang curvelinear doubleclick leapyear lod merchantibility nd numer ois ony que seeked synching te uint unselect webp EOF $ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po" $ git diff // undo unwanted changes ```
* Use approximate equallity methods in many placesAaron Franke2019-04-251-5/+5
|
* Fix CSG crash, closes #26281Juan Linietsky2019-03-011-2/+4
|
* Add -Wshadow=local to warnings and fix reported issues.marxin2019-02-201-6/+6
| | | | Fixes #25316.
* Core: Ensure classes match their header filenameRémi Verschelde2019-02-121-1/+1
| | | | | | | | | | | | | | | Also drop some unused files. Renamed: - `core/dvector.h` -> `pool_vector.h` - `core/io/resource_import.h` -> `resource_importer.h` - `core/sort.h` -> `sort_array.h` - `core/string_db.h` -> `string_name.h` Dropped: - `core/allocators.h` - `core/os/shell.h` - `core/variant_construct_string.cpp`