summaryrefslogtreecommitdiffstats
path: root/modules/csg/csg.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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`
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Remove redundant "== true" codeAaron Franke2018-10-061-1/+1
| | | If it can be compared to a boolean, it can be evaluated as one in-place.
* Fix GCC 8 warnings about potentially unitialized variablesRémi Verschelde2018-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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] ```
* Merge pull request #21982 from luzpaz/misc-typosRémi Verschelde2018-09-131-5/+5
|\ | | | | Misc. typos
| * Misc. typosluz.paz2018-09-121-5/+5
| | | | | | Found via `codespell -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"`
* | Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-4/+4
|/ | | | | | 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.
* Reduce unnecessary COW on Vector by make writing explicitHein-Pieter van Braam2018-07-261-37/+37
| | | | | | | | | | | | | | | | | | | | | | | This commit makes operator[] on Vector const and adds a write proxy to it. From now on writes to Vectors need to happen through the .write proxy. So for instance: Vector<int> vec; vec.push_back(10); std::cout << vec[0] << std::endl; vec.write[0] = 20; Failing to use the .write proxy will cause a compilation error. In addition COWable datatypes can now embed a CowData pointer to their data. This means that String, CharString, and VMap no longer use or derive from Vector. _ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug builds. This is a lot faster for Vector in the editor and while running tests. The reason why this difference used to exist is because force-inlined methods used to give a bad debugging experience. After extensive testing with modern compilers this is no longer the case.
* Add missing copyright headersGuilherme Felipe2018-05-161-0/+30
|
* updated OAHashMap to use robinhood hashingkarroffel2018-05-031-1/+1
|
* -Changed how operators work, any shape can operate on any otherJuan Linietsky2018-04-281-4/+17
| | | | -Added some break condition for bad poly data to avoid editor freezes