Skip to content

Commit

Permalink
Make CSG shape dirty after changing Snap, update doc
Browse files Browse the repository at this point in the history
Update doc to mention that Snap only takes effect at the top level.

Co-authored-by: Hugo Locurcio <[email protected]>
  • Loading branch information
31 and Calinou committed Jun 16, 2024
1 parent 71699e0 commit 649c87b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions modules/csg/csg_shape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion modules/csg/doc_classes/CSGShape3D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand Down

0 comments on commit 649c87b

Please sign in to comment.