From eb88aef537bf7206340e9e64ecf85eb9585ff53b Mon Sep 17 00:00:00 2001 From: smix8 <52464204+smix8@users.noreply.github.com> Date: Mon, 19 Dec 2022 19:01:27 +0100 Subject: Add GridMap collision_priority Adds property 'collision_priority' for all physics bodies of the entire GridMap. --- modules/gridmap/grid_map.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'modules/gridmap/grid_map.h') diff --git a/modules/gridmap/grid_map.h b/modules/gridmap/grid_map.h index 02a988935d..59d2936f2c 100644 --- a/modules/gridmap/grid_map.h +++ b/modules/gridmap/grid_map.h @@ -150,6 +150,7 @@ class GridMap : public Node3D { uint32_t collision_layer = 1; uint32_t collision_mask = 1; + real_t collision_priority = 1.0; Ref physics_material; bool bake_navigation = false; RID map_override; @@ -185,7 +186,7 @@ class GridMap : public Node3D { return Vector3(p_key.x, p_key.y, p_key.z) * cell_size * octant_size; } - void _reset_physic_bodies_collision_filters(); + void _update_physics_bodies_collision_properties(); void _octant_enter_world(const OctantKey &p_key); void _octant_exit_world(const OctantKey &p_key); bool _octant_update(const OctantKey &p_key); @@ -240,6 +241,9 @@ public: void set_collision_mask_value(int p_layer_number, bool p_value); bool get_collision_mask_value(int p_layer_number) const; + void set_collision_priority(real_t p_priority); + real_t get_collision_priority() const; + void set_physics_material(Ref p_material); Ref get_physics_material() const; -- cgit v1.2.3