summaryrefslogtreecommitdiff
path: root/servers/physics_3d/collision_object_3d_sw.h
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-06-29 21:34:45 +0200
committerGitHub <noreply@github.com>2020-06-29 21:34:45 +0200
commit8e8699e36b81f04fb7acb403bb567648f576867f (patch)
tree2cff2c6e6378775f32958ab88df9b940edfbdd0e /servers/physics_3d/collision_object_3d_sw.h
parent4599381fad10a20ffd2d4eadf7e9de99ef15ac80 (diff)
parent79d3d3d17b3b5ade28f77562eb25c55a2f07229a (diff)
Merge pull request #39894 from madmiraal/fix-39768
Trigger broadphase update when changing collision layer/mask.
Diffstat (limited to 'servers/physics_3d/collision_object_3d_sw.h')
-rw-r--r--servers/physics_3d/collision_object_3d_sw.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/servers/physics_3d/collision_object_3d_sw.h b/servers/physics_3d/collision_object_3d_sw.h
index 9506f14402..a3a5787ced 100644
--- a/servers/physics_3d/collision_object_3d_sw.h
+++ b/servers/physics_3d/collision_object_3d_sw.h
@@ -142,10 +142,16 @@ public:
return shapes[p_idx].disabled;
}
- _FORCE_INLINE_ void set_collision_layer(uint32_t p_layer) { collision_layer = p_layer; }
+ _FORCE_INLINE_ void set_collision_layer(uint32_t p_layer) {
+ collision_layer = p_layer;
+ _shape_changed();
+ }
_FORCE_INLINE_ uint32_t get_collision_layer() const { return collision_layer; }
- _FORCE_INLINE_ void set_collision_mask(uint32_t p_mask) { collision_mask = p_mask; }
+ _FORCE_INLINE_ void set_collision_mask(uint32_t p_mask) {
+ collision_mask = p_mask;
+ _shape_changed();
+ }
_FORCE_INLINE_ uint32_t get_collision_mask() const { return collision_mask; }
_FORCE_INLINE_ bool test_collision_mask(CollisionObject3DSW *p_other) const {