summaryrefslogtreecommitdiff
path: root/modules/csg/csg.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-08-04Fix some array size function definition mismatch.Fabio Alessandrelli
2022-05-16Replace most uses of Map by HashMapreduz
* 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-10Fix warnings found by Emscripten 3.1.10Rémi Verschelde
Fix `-Wunused-but-set-variable`, `-Wunqualified-std-cast-call`, and `-Wliteral-range` warnings.
2022-05-06Rename `CSGPrimitive3D.invert_faces` to `flip_faces`hoontee
2022-05-03Rename Basis get_axis to get_column, remove redundant methodsAaron Franke
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-11-23Rename `remove()` to `remove_at()` when removing by indexLightning_A
2021-10-28clang-format: Disable alignment of operands, too unreliableRémi Verschelde
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`.
2021-10-12Fixed a typo in csg moduleM. Huri
2021-09-30Use range iterators for `Map`Lightning_A
2021-09-29Use functions defined in the their classes.Anilforextra
2021-09-27Fix Typo: Segement.Anilforextra
2021-09-21Add Get Center Method for Rect2/Rect2i and AABB.Anilforextra
2021-07-23Use C++ iterators for Lists in many situationsAaron Franke
2021-07-21Use is_equal_approx in more placesAaron Franke
2021-06-03Rename Transform to Transform3D in coreAaron Franke
2021-03-21Rename Array.invert() to Array.reverse()Marcel Admiraal
Does the same internally for List and Vector<>, which includes all PackedArray types.
2021-03-12Fixes small typos and grammar correctionAnshul7sp1
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-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-08-13Don't attempt to insert points into degenerate triangles.Marcel Admiraal
Use a simpler degenerate triangle check that calculates area.
2020-08-12Mark the first shape as inside, not the second shape, when CSG shapes areMarcel Admiraal
co-planer.
2020-06-29Use is_equal_approx() instead of vertex_snap when checking if ray isMarcel Admiraal
colliding with equiplanar CSG faces.
2020-06-29Create degenerate triangles when inserting an edge into a CSG face.Marcel Admiraal
They will be deleted when the faces are merged, but their edges are needed for merging faces.
2020-06-21Check if point's index exists before adding it to the list of pointsMarcel Admiraal
that need to split faces when avoiding creating degenerate faces while merging CSG faces.
2020-05-27Split `Geometry` singleton into `Geometry2D` and `Geometry3D`Andrii Doroshenko (Xrayez)
Extra `_2d` suffixes are removed from 2D methods accoringly.
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-05-10Style: clang-format: Disable AllowShortIfStatementsOnASingleLineRémi Verschelde
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.
2020-04-29[Core] Rename linear_interpolate to lerpAaron Franke
2020-03-17Style: Set clang-format Standard to Cpp11Rémi Verschelde
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`.
2020-03-11Fix various typosluz.paz
Found via `codespell`
2020-02-21Fix multiple issues with CSG module.Marcel Admiraal
- 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.
2020-02-18PoolVector is gone, replaced by VectorJuan Linietsky
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
2020-01-01Update copyright statements to 2020Rémi Verschelde
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.
2019-10-14Replace vector == and is_zero_approx(distance) with is_equal_approxAaron Franke
Internal changes only
2019-09-19Fix misc. source comment typosluz.paz
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 `
2019-08-19Replace is_zero_approx(A.distance_to(B)) with A==BPaul Trojahn
Related to #22988 (Fixes the holes in the shape of the first comment)
2019-06-20Merge pull request #29283 from qarmin/fix_some_always_same_valuesRémi Verschelde
Remove always true/false values
2019-06-20Fix always true/false valuesqarmin
2019-06-11Fix error macro calls not ending with semicolonRémi Verschelde
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.
2019-05-19Fix typos with codespellRémi Verschelde
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 ```
2019-04-25Use approximate equallity methods in many placesAaron Franke
2019-03-01Fix CSG crash, closes #26281Juan Linietsky
2019-02-20Add -Wshadow=local to warnings and fix reported issues.marxin
Fixes #25316.
2019-02-12Core: Ensure classes match their header filenameRémi Verschelde
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`
2019-01-01Update copyright statements to 2019Rémi Verschelde
Happy new year to the wonderful Godot community!
2018-10-06Remove redundant "== true" codeAaron Franke
If it can be compared to a boolean, it can be evaluated as one in-place.
2018-10-04Fix GCC 8 warnings about potentially unitialized variablesRémi Verschelde
Fixes the following GCC 8 warnings: ``` core/image.cpp:730:44: warning: 'mip1_weight' may be used uninitialized in this function [-Wmaybe-uninitialized] core/image.cpp:293:20: warning: 'mip2' may be used uninitialized in this function [-Wmaybe-uninitialized] core/image.cpp:293:20: warning: 'mip1' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/audio_stream_preview.cpp:58:19: warning: 'vmax' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/audio_stream_preview.cpp:85:19: warning: 'vmin' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/editor_themes.cpp:306:53: warning: 'preset_contrast' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/plugins/animation_blend_space_2d_editor.cpp:459:27: warning: 'prev_idx' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/plugins/animation_blend_space_2d_editor.cpp:443:27: warning: 'prev_idx' may be used uninitialized in this function [-Wmaybe-uninitialized] main/tests/test_oa_hash_map.cpp:57:29: warning: 'value' may be used uninitialized in this function [-Wmaybe-uninitialized] modules/csg/csg.cpp:764:40: warning: 'max_angle' may be used uninitialized in this function [-Wmaybe-uninitialized] modules/csg/csg_shape.cpp:1945:3: warning: 'face_count' may be used uninitialized in this function [-Wmaybe-uninitialized] scene/3d/voxel_light_baker.cpp:1593:8: warning: 'cone_aperture' may be used uninitialized in this function [-Wmaybe-uninitialized] scene/3d/voxel_light_baker.cpp:1592:6: warning: 'cone_dir_count' may be used uninitialized in this function [-Wmaybe-uninitialized] scene/animation/animation_blend_space_2d.cpp:471:8: warning: 'mind' may be used uninitialized in this function [-Wmaybe-uninitialized] core/os/memory.cpp:94: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] core/os/memory.cpp:95: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] core/os/memory.cpp:98: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] ```