Implement VisualServerScene::instance_set_extra_visibility_margin() method to actually apply extra culling margin and mark instance AABB dirty

(cherry picked from commit fc166f3ee1)
This commit is contained in:
Markus Ewald 2018-03-04 14:20:59 +01:00 committed by Rémi Verschelde
parent ac1520325c
commit 3d5c5c28d5
1 changed files with 5 additions and 0 deletions

View File

@ -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) { 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<ObjectID> VisualServerScene::instances_cull_aabb(const AABB &p_aabb, RID p_scenario) const { Vector<ObjectID> VisualServerScene::instances_cull_aabb(const AABB &p_aabb, RID p_scenario) const {