summaryrefslogtreecommitdiff
path: root/modules/csg/csg_shape.cpp
AgeCommit message (Collapse)Author
2023-05-12 Fix CSG edge case causing intersection line to hit on common edge of 2 ↵K. S. Ernest (iFire) Lee
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> (cherry picked from commit eaa84bc682dfb7f1f97970c7f4dfd4c6e63ba681)
2023-02-13Add compatibility code for CSGBox3D width/height/depth from Godot 3.xDESKTOP-9O27V4U\Navi
Fixes #66420.
2023-01-31Don't generate CSGPolygon3D shape before the assigned path is inside treeMinusKube
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-10-07Fix MSVC warnings, rename shadowed variables, fix uninitialized values, ↵bruvzg
change warnings=all to use /W4.
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-26Rename `str2var` to `str_to_var` and similarMicky
Affects the Math class, a good chunk of the audio code, and a lot of other miscellaneous classes, too. - `var2str` -> `var_to_str` - `str2var` -> `str_to_var` - `bytes2var` -> `bytes_to_var` - `bytes2var_with_objects` -> `bytes_to_var_with_objects` - `var2bytes` -> `var_to_bytes` - `var2bytes_with_objects` -> `var_to_bytes_with_objects` - `linear2db` -> `linear_to_db` - `db2linear` -> `db_to_linear` - `deg2rad` -> `deg_to_rad` - `rad2deg` -> `rad_to_deg` - `dict2inst` -> `dict_to_inst` - `inst2dict` -> `inst_to_dict`
2022-08-22Merge pull request #64339 from YuriSizov/core-multilevel-validate-propertyRémi Verschelde
2022-08-22Make `_validate_property` a multilevel methodYuri Sizov
2022-08-22Merge pull request #64343 from TokageItLab/priority-phRémi Verschelde
2022-08-18Remove unintentional PROPERTY_USAGE_INTERNALRedMser
The flag only matters for property definition, but was also used in _validate_property a lot.
2022-08-18Add collision weight to PhysicsBody for penetrations must be avoidedSilc Renew
Co-authored-by: Juan Linietsky <reduzio@gmail.com>
2022-07-16rename translate(d) to translate(d)_local in Transform 2D/3DFabian Keller
2022-06-11Add suffixes to all nodes and resourcesFireForge
2022-05-19Use suffixes for units in nodes and resourcesAaron Franke
2022-05-06Rename `CSGPrimitive3D.invert_faces` to `flip_faces`hoontee
2022-04-27Decrease default sizes of some primitive and CSG meshes for consistencyHugo Locurcio
2022-03-11Prevent non-smoothed face normals to participate to smoothed face normalsMythTitans
2022-03-11Fix normals computation at the 'seam' of smoothed torus shapeMythTitans
2022-03-10Discern between virtual and abstract class bindingsreduz
* Previous "virtual" classes (which can't be instantiated) are not corretly named "abstract". * Added a new "virtual" category for classes, they can't be instantiated from the editor, but can be inherited from script and extensions. * Converted a large amount of classes from "abstract" to "virtual" where it makes sense. Most classes that make sense have been converted. Missing: * Physics servers * VideoStream * Script* classes. which will go in a separate PR due to the complexity involved.
2022-03-09Revert #52647hoontee
2022-03-09Add SNAME macro optimization missed during rebasehoontee
2022-03-08Properly handle CSGShape parent and visibility updates, plus some refactoringhoontee
2022-02-16Fix normals computation at the 'seam' of smoothed sphere and cylinder shapesMythTitans
2022-02-16Convert _notification methods to switch - Chunk CJakob Bouchard
2022-02-01Improve the default size for 3D shapes (Box, Capsule, and Cylinder)Aaron Franke
2022-01-21Improve CSGPolygon3D documentationHugo Locurcio
- Describe why polygon triangulation usually fails in the error message.
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2022-01-02Fix various typosluz paz
Found via ` codespell -q 3 -S ./thirdparty,*.po,./DONORS.md -L ackward,ang,ans,ba,beng,cas,childs,childrens,dof,doubleclick,expct,fave,findn,gird,hist,inout,leapyear,lod,nd,numer,ois,ony,paket,seeked,sinc,switchs,te,uint,varn` Update editor/import/resource_importer_layered_texture.cpp Co-authored-by: Raul Santos <raulsntos@gmail.com> Update doc/classes/TileSetScenesCollectionSource.xml Co-authored-by: Raul Santos <raulsntos@gmail.com> Update scene/gui/graph_edit.cpp Co-authored-by: Raul Santos <raulsntos@gmail.com> Update scene/resources/animation.cpp Co-authored-by: Raul Santos <raulsntos@gmail.com> Update scene/resources/animation.cpp Co-authored-by: Raul Santos <raulsntos@gmail.com> Update scene/resources/animation.cpp Co-authored-by: Raul Santos <raulsntos@gmail.com> Update scene/gui/rich_text_label.cpp Co-authored-by: Raul Santos <raulsntos@gmail.com> Revert previously committed change
2021-11-03Rename `PROPERTY_USAGE_NOEDITOR` to `PROPERTY_USAGE_NO_EDITOR`Hugo Locurcio
This is consistent with other constants that include `NO`, such as `PROPERTY_HINT_COLOR_NO_ALPHA`.
2021-10-25Refactored Node3D rotation modesreduz
* Made the Basis euler orders indexed via enum. * Node3D has a new rotation_order property to choose Euler rotation order. * Node3D has also a rotation_mode property to choose between Euler, Quaternion and Basis Exposing these modes as well as the order makes Godot a lot friendlier for animators, which can choose the best way to interpolate rotations. The new *Basis* mode makes the (exposed) transform property obsolete, so it was removed (can still be accessed by code of course).
2021-10-12Fixed a typo in csg moduleM. Huri
2021-09-27CSGPolygon fixes and features: Angle simplification, UV tiling distance, ↵jitspoe
interval type.
2021-09-14Don't update CSG Shape when not inside treeHaoyu Qiu
2021-08-12Merge pull request #51532 from nekomatata/layer-mask-accessorsRémi Verschelde
Uniformize layer names, script methods and documentation
2021-08-12Uniformize layer names, script methods and documentationPouleyKetchoupp
- Back to 1-based layer names to make it clearer in editor UI - Layer bit accessors are renamed to layer value and 1-based too - Uniform errors and documentation in render and physics - Fix a few remaining collision_layer used in place of collision_mask
2021-08-12Fix multiple issues with CSGPolygonMarcel Admiraal
2021-07-26Fix CSGSphere3D mesh creationAaron Franke
2021-07-23Node3D gizmo improvementsjfons
* Clean-up of node_3d_editor_plugin.{h,cpp}: removed unused code, fixed some bugs. * Moved node_3d_editor_gizmos.{h,cpp} to editor/plugins. * Added support for multiple gizmos per node. This means custom gizmos will no longer override the built-in ones and that multiple gizmos can be used in more complex nodes. * Added support for handle IDs. When adding handles to a gizmo, an ID can be specified for each one, making it easier to work with gizmos that have a variable number of handles. * Added support for subgizmos, selectable elements that can be transformed without needing a node of their own. By overriding _subgizmo_intersect_frustum() and/or _subgizmo_intersect_ray() gizmos can define which subgizmos should be selected on a region or click selection. Subgizmo transformations are applied using get/set/commit virtual methods, similar to how handles work.
2021-07-21Use is_equal_approx in more placesAaron Franke
2021-07-18Optimize StringName usagereduz
* Added a new macro SNAME() that constructs and caches a local stringname. * Subsequent usages use the cached version. * Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time. * Replaced all theme usages by this new macro. * Replace all signal emission usages by this new macro. * Replace all call_deferred usages by this new macro. This is part of ongoing work to optimize GUI and the editor.
2021-07-04Allow using ORMMaterial3D by using BaseMaterial3D as a resource hintHugo Locurcio
Previously, only StandardMaterial3D could be defined as an alternative to ShaderMaterial. This also reorders the CanvasItemMaterial property hints to follow alphabetical order (which is enforced by the inspector).
2021-07-01Use PROPERTY_USAGE_NONE instead of 0 for no property usageAaron Franke
Also use const more often.
2021-06-30Fix editor suffixes and degrees conversionreduz
* Functions to convert to/from degrees are all gone. Conversion is done by the editor. * Use PROPERTY_HINT_ANGLE instead of PROPERTY_HINT_RANGE to edit radian angles in degrees. * Added possibility to add suffixes to range properties, use "min,max[,step][,suffix:<something>]" example "0,100,1,suffix:m" * In general, can add suffixes for EditorSpinSlider Not covered by this PR, will have to be addressed by future ones: * Ability to switch radians/degrees in the inspector for angle properties (if actually wanted). * Animations previously made will most likely break, need to add a way to make old ones compatible. * Only added a "px" suffix to 2D position and a "m" one to 3D position, someone needs to go through the rest of the engine and add all remaining suffixes. * Likely also need to track down usage of EditorSpinSlider outside properties to add suffixes to it too.
2021-06-19Rename `instance()`->`instantiate()` when it's a verbLightning_A
2021-06-03Rename Transform to Transform3D in coreAaron Franke
2021-05-29Fix UV mapping on CSGSphereMarcel Admiraal
2021-05-01Change Path to Path3D in CSGPolygon3Drafallus
2021-04-30Prevent setting too big or too small Collision Mask and LayerRafał Mikrut
2021-04-27Fix CSG Path Polygon cache being removed after connectJohannes Witt
fixes #30229