Codecleanup for #1482

This commit is contained in:
Wojtek Figat
2024-02-19 17:33:21 +01:00
parent 0d1dbd8845
commit 2de890ca6a
5 changed files with 69 additions and 83 deletions

View File

@@ -334,6 +334,22 @@ namespace FlaxEditor.Viewport
}
}
/// <summary>
/// Gets the bounding frustum of the current viewport camera.
/// </summary>
public BoundingFrustum ViewFrustum
{
get
{
Vector3 viewOrigin = Task.View.Origin;
Float3 position = ViewPosition - viewOrigin;
CreateViewMatrix(position, out var view);
CreateProjectionMatrix(out var projection);
Matrix.Multiply(ref view, ref projection, out var viewProjection);
return new BoundingFrustum(ref viewProjection);
}
}
/// <summary>
/// Gets or sets the yaw angle (in degrees).
/// </summary>