Fix selecting objects/gizmos with high far plane.

This commit is contained in:
Chandler Cox
2023-12-02 09:12:38 -06:00
parent 712c400e43
commit 9a712ba3cf

View File

@@ -1374,8 +1374,8 @@ namespace FlaxEditor.Viewport
ivp.Invert();
// Create near and far points
var nearPoint = new Vector3(mousePosition, 0.0f);
var farPoint = new Vector3(mousePosition, 1.0f);
var nearPoint = new Vector3(mousePosition, _nearPlane);
var farPoint = new Vector3(mousePosition, _farPlane);
viewport.Unproject(ref nearPoint, ref ivp, out nearPoint);
viewport.Unproject(ref farPoint, ref ivp, out farPoint);