Codecleanup for #1482
This commit is contained in:
@@ -104,6 +104,16 @@ namespace FlaxEngine
|
||||
GetPlanesFromMatrix(ref pMatrix, out pNear, out pFar, out pLeft, out pRight, out pTop, out pBottom);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of BoundingFrustum.
|
||||
/// </summary>
|
||||
/// <param name="matrix">Combined matrix that usually takes view × projection matrix.</param>
|
||||
public BoundingFrustum(ref Matrix matrix)
|
||||
{
|
||||
pMatrix = matrix;
|
||||
GetPlanesFromMatrix(ref pMatrix, out pNear, out pFar, out pLeft, out pRight, out pTop, out pBottom);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a hash code for this instance.
|
||||
/// </summary>
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace FlaxEngine
|
||||
Matrix.Invert(ref View, out IV);
|
||||
Matrix.Invert(ref Projection, out IP);
|
||||
Matrix.Multiply(ref View, ref Projection, out var viewProjection);
|
||||
Frustum = new BoundingFrustum(viewProjection);
|
||||
Frustum = new BoundingFrustum(ref viewProjection);
|
||||
Matrix.Invert(ref viewProjection, out IVP);
|
||||
CullingFrustum = Frustum;
|
||||
}
|
||||
|
||||
@@ -450,7 +450,7 @@ namespace FlaxEngine
|
||||
{
|
||||
camera.GetMatrices(out tmp1, out var tmp3, ref viewport);
|
||||
Matrix.Multiply(ref tmp1, ref tmp3, out tmp2);
|
||||
var frustum = new BoundingFrustum(tmp2);
|
||||
var frustum = new BoundingFrustum(ref tmp2);
|
||||
_guiRoot.Size = new Float2(frustum.GetWidthAtDepth(Distance), frustum.GetHeightAtDepth(Distance));
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user