summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-06-17 10:59:09 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-06-17 10:59:09 +0200
commit8c70c18132441d11a88dd96b462d89d8eba4c2f5 (patch)
tree9161a0fcb51c732ae31a7b2710bc0d70c64c73f7
parent63cb43a05957bca359e8bed72e72d81ce1ccdf52 (diff)
parent649c87b9573c62814e20cfbad4deaa07c13fa87d (diff)
downloadredot-engine-8c70c18132441d11a88dd96b462d89d8eba4c2f5.tar.gz
Merge pull request #93242 from 31/dev/31/csg-snap-dirty
Make CSG shape dirty after changing Snap
-rw-r--r--modules/csg/csg_shape.cpp5
-rw-r--r--modules/csg/doc_classes/CSGShape3D.xml2
2 files changed, 6 insertions, 1 deletions
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp
index 8d2847ab1a..296cda627a 100644
--- a/modules/csg/csg_shape.cpp
+++ b/modules/csg/csg_shape.cpp
@@ -141,7 +141,12 @@ bool CSGShape3D::is_root_shape() const {
}
void CSGShape3D::set_snap(float p_snap) {
+ if (snap == p_snap) {
+ return;
+ }
+
snap = p_snap;
+ _make_dirty();
}
float CSGShape3D::get_snap() const {
diff --git a/modules/csg/doc_classes/CSGShape3D.xml b/modules/csg/doc_classes/CSGShape3D.xml
index 0414aa362d..f9017e47c7 100644
--- a/modules/csg/doc_classes/CSGShape3D.xml
+++ b/modules/csg/doc_classes/CSGShape3D.xml
@@ -73,7 +73,7 @@
The operation that is performed on this shape. This is ignored for the first CSG child node as the operation is between this node and the previous child of this nodes parent.
</member>
<member name="snap" type="float" setter="set_snap" getter="get_snap" default="0.001">
- Snap makes the mesh vertices snap to a given distance so that the faces of two meshes can be perfectly aligned. A lower value results in greater precision but may be harder to adjust.
+ Snap makes the mesh vertices snap to a given distance so that the faces of two meshes can be perfectly aligned. A lower value results in greater precision but may be harder to adjust. The top-level CSG shape's snap value is used for the entire CSG tree.
</member>
<member name="use_collision" type="bool" setter="set_use_collision" getter="is_using_collision" default="false">
Adds a collision shape to the physics engine for our CSG shape. This will always act like a static body. Note that the collision shape is still active even if the CSG shape itself is hidden. See also [member collision_mask] and [member collision_priority].