From fc166f3ee1c48b1064e380219342cdd6e1cfb525 Mon Sep 17 00:00:00 2001 From: Markus Ewald Date: Sun, 4 Mar 2018 14:20:59 +0100 Subject: [PATCH] Implement VisualServerScene::instance_set_extra_visibility_margin() method to actually apply extra culling margin and mark instance AABB dirty --- servers/visual/visual_server_scene.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp index 0920fa748bc..57364ff1afd 100644 --- a/servers/visual/visual_server_scene.cpp +++ b/servers/visual/visual_server_scene.cpp @@ -730,6 +730,11 @@ void VisualServerScene::instance_set_exterior(RID p_instance, bool p_enabled) { } void VisualServerScene::instance_set_extra_visibility_margin(RID p_instance, real_t p_margin) { + Instance *instance = instance_owner.get(p_instance); + ERR_FAIL_COND(!instance); + + instance->extra_margin = p_margin; + _instance_queue_update(instance, true, false); } Vector VisualServerScene::instances_cull_aabb(const AABB &p_aabb, RID p_scenario) const {