Merge pull request #37863 from ExpiredPopsicle/culling5

Fixed false positives in the culling system.
This commit is contained in:
Rémi Verschelde 2020-04-30 08:05:11 +02:00 committed by GitHub
commit 8d93303483
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 95 additions and 25 deletions

View file

@ -669,17 +669,13 @@ void SpatialEditorViewport::_select_region() {
}
}
if (!orthogonal) {
Plane near(cam_pos, -_get_camera_normal());
near.d -= get_znear();
Plane near(cam_pos, -_get_camera_normal());
near.d -= get_znear();
frustum.push_back(near);
frustum.push_back(near);
Plane far = -near;
far.d += get_zfar();
frustum.push_back(far);
}
Plane far = -near;
far.d += get_zfar();
frustum.push_back(far);
Vector<ObjectID> instances = VisualServer::get_singleton()->instances_cull_convex(frustum, get_tree()->get_root()->get_world()->get_scenario());
Vector<Node *> selected;