You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Fixed false positives in the culling system.
This fixes numerous false positives coming out of the culling system. AABB checks are now a full separating-axis check against the frustum, with the points of the frustum being compared to the planes of the box just as the points of the box were being compared to the planes of the frustum. This fixes large objects behind the camera not being culled correctly. Some systems that used frustums that were (sometimes mistakenly?) unbounded on one or more side have been modified to be fully enclosed.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user