< Summary

Information
Class: FixedMathSharp.BoundingFrustum
Assembly: FixedMathSharp
File(s): /home/runner/work/FixedMathSharp/FixedMathSharp/src/FixedMathSharp/Geometry/Bounds/BoundingFrustum.cs
Line coverage
99%
Covered lines: 317
Uncovered lines: 3
Coverable lines: 320
Total lines: 643
Line coverage: 99%
Branch coverage
96%
Covered branches: 121
Total branches: 126
Branch coverage: 96%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.cctor()100%11100%
.ctor(...)100%11100%
.ctor(...)100%11100%
.ctor(...)100%44100%
get_HasMatrix()100%11100%
get_Matrix()100%22100%
set_Matrix(...)100%11100%
get_Near()100%11100%
get_Far()100%11100%
get_Left()100%11100%
get_Right()100%11100%
get_Top()100%11100%
get_Bottom()100%11100%
Contains(...)100%44100%
Contains(...)100%88100%
Contains(...)87.5%88100%
Contains(...)100%88100%
Contains(...)100%1212100%
Intersects(...)100%11100%
Intersects(...)100%11100%
Intersects(...)100%11100%
Intersects(...)100%11100%
Intersects(...)93.75%1616100%
Intersects(...)100%44100%
ClampPoint(...)100%1010100%
GetCorners()100%11100%
GetCorners(...)100%44100%
GetPlanes()100%11100%
GetPlanes(...)100%44100%
SetMatrix(...)100%11100%
SetPlanes(...)100%22100%
SetPlanes(...)100%11100%
CreatePlanes(...)100%11100%
CreateCorners()100%11100%
UpdateBounds()100%22100%
IntersectionPoint(...)50%2290%
IsInside(...)100%44100%
UpdateNearestCandidate(...)100%22100%
IntersectsFrustum(...)85.71%141491.3%
Separates(...)100%22100%
Project(...)100%66100%
Equals(...)100%66100%
Equals(...)100%22100%
GetHashCode()100%11100%

File(s)

/home/runner/work/FixedMathSharp/FixedMathSharp/src/FixedMathSharp/Geometry/Bounds/BoundingFrustum.cs

#LineLine coverage
 1using System;
 2using System.Runtime.CompilerServices;
 3
 4namespace FixedMathSharp;
 5
 6/// <summary>
 7/// Represents a frustum bounded by six clipping planes.
 8/// </summary>
 9public sealed class BoundingFrustum : IEquatable<BoundingFrustum>
 10{
 11    #region Constants
 12
 13    /// <summary>
 14    /// The number of planes in a frustum.
 15    /// </summary>
 16    public const int PlaneCount = 6;
 17
 18    /// <summary>
 19    /// The number of corner points in a frustum.
 20    /// </summary>
 21    public const int CornerCount = 8;
 22
 23    #endregion
 24
 25    #region Fields
 26
 27    private Fixed4x4? _matrix;
 28    private readonly Vector3d[] _corners;
 29    private readonly FixedPlane[] _planes;
 30
 131    private static readonly (int Start, int End)[] Edges =
 132    {
 133        (0, 1), (1, 2), (2, 3), (3, 0),
 134        (4, 5), (5, 6), (6, 7), (7, 4),
 135        (0, 4), (1, 5), (2, 6), (3, 7)
 136    };
 37
 38    #endregion
 39
 40    #region Constructors
 41
 42    /// <summary>
 43    /// Initializes a new frustum by extracting the planes and corners from a combined view-projection matrix.
 44    /// </summary>
 3845    public BoundingFrustum(Fixed4x4 matrix)
 3846    {
 3847        _corners = new Vector3d[CornerCount];
 3848        _planes = new FixedPlane[PlaneCount];
 3849        SetMatrix(matrix);
 3850    }
 51
 52    /// <summary>
 53    /// Initializes a new frustum from six clipping planes.
 54    /// </summary>
 355    public BoundingFrustum(
 356        FixedPlane near,
 357        FixedPlane far,
 358        FixedPlane left,
 359        FixedPlane right,
 360        FixedPlane top,
 361        FixedPlane bottom)
 362    {
 363        _corners = new Vector3d[CornerCount];
 364        _planes = new FixedPlane[PlaneCount];
 365        SetPlanes(near, far, left, right, top, bottom);
 366    }
 67
 68    /// <summary>
 69    /// Initializes a new frustum from six clipping planes in near, far, left, right, top, bottom order.
 70    /// </summary>
 371    public BoundingFrustum(FixedPlane[] planes)
 372    {
 373        if (planes == null)
 174            throw new ArgumentNullException(nameof(planes));
 75
 276        if (planes.Length != PlaneCount)
 177            throw new ArgumentException($"A frustum must be defined by exactly {PlaneCount} planes.", nameof(planes));
 78
 179        _corners = new Vector3d[CornerCount];
 180        _planes = new FixedPlane[PlaneCount];
 181        SetPlanes(planes);
 182    }
 83
 84    #endregion
 85
 86    #region Properties
 87
 88    /// <summary>
 89    /// Gets a value indicating whether this frustum was created from a matrix source.
 90    /// </summary>
 91    public bool HasMatrix
 92    {
 93        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 294        get => _matrix.HasValue;
 95    }
 96
 97    /// <summary>
 98    /// Gets or sets the matrix source used to define this frustum.
 99    /// </summary>
 100    /// <exception cref="InvalidOperationException">
 101    /// Thrown when reading the matrix from a frustum that was created from planes.
 102    /// </exception>
 103    public Fixed4x4 Matrix
 104    {
 105        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 2106        get => _matrix ?? throw new InvalidOperationException("This frustum was not created from a matrix.");
 1107        set => SetMatrix(value);
 108    }
 109
 110    /// <summary>
 111    /// Gets the near clipping plane.
 112    /// </summary>
 113    public FixedPlane Near
 114    {
 115        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 2116        get => _planes[0];
 117    }
 118
 119    /// <summary>
 120    /// Gets the far clipping plane.
 121    /// </summary>
 122    public FixedPlane Far
 123    {
 124        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 1125        get => _planes[1];
 126    }
 127
 128    /// <summary>
 129    /// Gets the left clipping plane.
 130    /// </summary>
 131    public FixedPlane Left
 132    {
 133        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 1134        get => _planes[2];
 135    }
 136
 137    /// <summary>
 138    /// Gets the right clipping plane.
 139    /// </summary>
 140    public FixedPlane Right
 141    {
 142        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 1143        get => _planes[3];
 144    }
 145
 146    /// <summary>
 147    /// Gets the top clipping plane.
 148    /// </summary>
 149    public FixedPlane Top
 150    {
 151        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 1152        get => _planes[4];
 153    }
 154
 155    /// <summary>
 156    /// Gets the bottom clipping plane.
 157    /// </summary>
 158    public FixedPlane Bottom
 159    {
 160        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 1161        get => _planes[5];
 162    }
 163
 164    /// <summary>
 165    /// Gets the minimum corner of the axis-aligned box that encloses the frustum.
 166    /// </summary>
 167    public Vector3d Min { get; private set; }
 168
 169    /// <summary>
 170    /// Gets the maximum corner of the axis-aligned box that encloses the frustum.
 171    /// </summary>
 172    public Vector3d Max { get; private set; }
 173
 174    #endregion
 175
 176    #region Methods
 177
 178    /// <summary>
 179    /// Tests a point against this frustum.
 180    /// </summary>
 181    public ContainmentType Contains(Vector3d point)
 38182    {
 406183        for (int i = 0; i < PlaneCount; i++)
 180184        {
 180185            if (_planes[i].DotCoordinate(point) > Fixed64.Zero)
 15186                return ContainmentType.Disjoint;
 165187        }
 188
 23189        return ContainmentType.Contains;
 38190    }
 191
 192    /// <summary>
 193    /// Tests a bounding box against this frustum.
 194    /// </summary>
 195    public ContainmentType Contains(BoundingBox box)
 9196    {
 9197        bool intersects = false;
 198
 108199        for (int i = 0; i < PlaneCount; i++)
 48200        {
 48201            switch (_planes[i].Intersects(box))
 202            {
 203                case FixedPlaneIntersectionType.Front:
 3204                    return ContainmentType.Disjoint;
 205                case FixedPlaneIntersectionType.Intersecting:
 17206                    intersects = true;
 17207                    break;
 208            }
 45209        }
 210
 6211        return intersects ? ContainmentType.Intersects : ContainmentType.Contains;
 9212    }
 213
 214    /// <summary>
 215    /// Tests a bounding area against this frustum.
 216    /// </summary>
 217    public ContainmentType Contains(BoundingArea area)
 4218    {
 4219        bool intersects = false;
 220
 44221        for (int i = 0; i < PlaneCount; i++)
 20222        {
 20223            switch (_planes[i].Intersects(area))
 224            {
 225                case FixedPlaneIntersectionType.Front:
 2226                    return ContainmentType.Disjoint;
 227                case FixedPlaneIntersectionType.Intersecting:
 14228                    intersects = true;
 14229                    break;
 230            }
 18231        }
 232
 2233        return intersects ? ContainmentType.Intersects : ContainmentType.Contains;
 4234    }
 235
 236    /// <summary>
 237    /// Tests a bounding sphere against this frustum.
 238    /// </summary>
 239    public ContainmentType Contains(BoundingSphere sphere)
 8240    {
 8241        bool intersects = false;
 242
 100243        for (int i = 0; i < PlaneCount; i++)
 44244        {
 44245            switch (_planes[i].Intersects(sphere))
 246            {
 247                case FixedPlaneIntersectionType.Front:
 2248                    return ContainmentType.Disjoint;
 249                case FixedPlaneIntersectionType.Intersecting:
 19250                    intersects = true;
 19251                    break;
 252            }
 42253        }
 254
 6255        return intersects ? ContainmentType.Intersects : ContainmentType.Contains;
 8256    }
 257
 258    /// <summary>
 259    /// Tests another frustum against this frustum.
 260    /// </summary>
 261    public ContainmentType Contains(BoundingFrustum frustum)
 8262    {
 8263        if (frustum == null)
 1264            throw new ArgumentNullException(nameof(frustum));
 265
 7266        if (Equals(frustum))
 1267            return ContainmentType.Contains;
 268
 6269        bool containsAllCorners = true;
 44270        for (int i = 0; i < CornerCount; i++)
 20271        {
 20272            if (Contains(frustum._corners[i]) == ContainmentType.Disjoint)
 4273            {
 4274                containsAllCorners = false;
 4275                break;
 276            }
 16277        }
 278
 6279        if (containsAllCorners)
 2280            return ContainmentType.Contains;
 281
 4282        return IntersectsFrustum(frustum)
 4283            ? ContainmentType.Intersects
 4284            : ContainmentType.Disjoint;
 7285    }
 286
 287    /// <summary>
 288    /// Checks whether a bounding box intersects this frustum.
 289    /// </summary>
 290    [MethodImpl(MethodImplOptions.AggressiveInlining)]
 7291    public bool Intersects(BoundingBox box) => Contains(box) != ContainmentType.Disjoint;
 292
 293    /// <summary>
 294    /// Checks whether a bounding area intersects this frustum.
 295    /// </summary>
 296    [MethodImpl(MethodImplOptions.AggressiveInlining)]
 4297    public bool Intersects(BoundingArea area) => Contains(area) != ContainmentType.Disjoint;
 298
 299    /// <summary>
 300    /// Checks whether a bounding sphere intersects this frustum.
 301    /// </summary>
 302    [MethodImpl(MethodImplOptions.AggressiveInlining)]
 6303    public bool Intersects(BoundingSphere sphere) => Contains(sphere) != ContainmentType.Disjoint;
 304
 305    /// <summary>
 306    /// Checks whether another frustum intersects this frustum.
 307    /// </summary>
 308    [MethodImpl(MethodImplOptions.AggressiveInlining)]
 3309    public bool Intersects(BoundingFrustum frustum) => Contains(frustum) != ContainmentType.Disjoint;
 310
 311    /// <summary>
 312    /// Finds the first forward intersection between the specified ray and this frustum.
 313    /// </summary>
 314    public Fixed64? Intersects(FixedRay ray)
 5315    {
 5316        Fixed64 tEnter = Fixed64.Zero;
 5317        Fixed64 tExit = Fixed64.MAX_VALUE;
 318
 52319        for (int i = 0; i < PlaneCount; i++)
 23320        {
 23321            FixedPlane plane = _planes[i];
 23322            Fixed64 distance = plane.DotCoordinate(ray.Position);
 23323            Fixed64 denominator = plane.DotNormal(ray.Direction);
 324
 23325            if (FixedRay.IsNearlyZero(denominator))
 14326            {
 14327                if (distance > Fixed64.Zero)
 1328                    return null;
 329
 13330                continue;
 331            }
 332
 9333            Fixed64 t = -distance / denominator;
 9334            if (denominator < Fixed64.Zero)
 4335            {
 4336                if (t > tEnter)
 3337                    tEnter = t;
 4338            }
 5339            else if (t < tExit)
 5340            {
 5341                tExit = t;
 5342            }
 343
 9344            if (tEnter > tExit)
 1345                return null;
 8346        }
 347
 3348        return tExit < Fixed64.Zero ? null : tEnter;
 5349    }
 350
 351    /// <summary>
 352    /// Classifies this frustum relative to a plane.
 353    /// </summary>
 354    public FixedPlaneIntersectionType Intersects(FixedPlane plane)
 3355    {
 3356        FixedPlaneIntersectionType result = plane.Intersects(_corners[0]);
 357
 34358        for (int i = 1; i < CornerCount; i++)
 15359        {
 15360            if (plane.Intersects(_corners[i]) != result)
 1361                return FixedPlaneIntersectionType.Intersecting;
 14362        }
 363
 2364        return result;
 3365    }
 366
 367    /// <summary>
 368    /// Clamps a point to this frustum, returning the point unchanged when it is already inside.
 369    /// </summary>
 370    public Vector3d ClampPoint(Vector3d point)
 5371    {
 5372        if (Contains(point) != ContainmentType.Disjoint)
 1373            return point;
 374
 4375        Vector3d best = _corners[0];
 4376        Fixed64 bestDistance = Vector3d.SqrDistance(point, best);
 377
 64378        for (int i = 1; i < CornerCount; i++)
 28379            UpdateNearestCandidate(point, _corners[i], ref best, ref bestDistance);
 380
 56381        for (int i = 0; i < PlaneCount; i++)
 24382        {
 24383            Vector3d candidate = Vector3d.ProjectOnPlane(point, _planes[i]);
 24384            if (IsInside(candidate))
 4385                UpdateNearestCandidate(point, candidate, ref best, ref bestDistance);
 24386        }
 387
 104388        for (int i = 0; i < Edges.Length; i++)
 48389        {
 48390            Vector3d candidate = Vector3d.ClosestPointOnLineSegment(point, _corners[Edges[i].Start], _corners[Edges[i].E
 48391            UpdateNearestCandidate(point, candidate, ref best, ref bestDistance);
 48392        }
 393
 4394        return best;
 5395    }
 396
 397    /// <summary>
 398    /// Returns a copy of the frustum corner array.
 399    /// </summary>
 400    public Vector3d[] GetCorners()
 14401    {
 14402        var corners = new Vector3d[CornerCount];
 14403        Array.Copy(_corners, corners, CornerCount);
 14404        return corners;
 14405    }
 406
 407    /// <summary>
 408    /// Copies this frustum's corners into the specified array.
 409    /// </summary>
 410    public void GetCorners(Vector3d[] corners)
 3411    {
 3412        if (corners == null)
 1413            throw new ArgumentNullException(nameof(corners));
 414
 2415        if (corners.Length < CornerCount)
 1416            throw new ArgumentOutOfRangeException(nameof(corners));
 417
 1418        Array.Copy(_corners, corners, CornerCount);
 1419    }
 420
 421    /// <summary>
 422    /// Returns a copy of the frustum plane array in near, far, left, right, top, bottom order.
 423    /// </summary>
 424    public FixedPlane[] GetPlanes()
 2425    {
 2426        var planes = new FixedPlane[PlaneCount];
 2427        Array.Copy(_planes, planes, PlaneCount);
 2428        return planes;
 2429    }
 430
 431    /// <summary>
 432    /// Copies this frustum's planes into the specified array in near, far, left, right, top, bottom order.
 433    /// </summary>
 434    public void GetPlanes(FixedPlane[] planes)
 3435    {
 3436        if (planes == null)
 1437            throw new ArgumentNullException(nameof(planes));
 438
 2439        if (planes.Length < PlaneCount)
 1440            throw new ArgumentOutOfRangeException(nameof(planes));
 441
 1442        Array.Copy(_planes, planes, PlaneCount);
 1443    }
 444
 445    private void SetMatrix(Fixed4x4 matrix)
 39446    {
 39447        _matrix = matrix;
 39448        CreatePlanes(matrix);
 39449        CreateCorners();
 39450        UpdateBounds();
 39451    }
 452
 453    private void SetPlanes(FixedPlane[] planes)
 1454    {
 14455        for (int i = 0; i < PlaneCount; i++)
 6456            _planes[i] = FixedPlane.Normalize(planes[i]);
 457
 1458        _matrix = null;
 1459        CreateCorners();
 1460        UpdateBounds();
 1461    }
 462
 463    private void SetPlanes(
 464        FixedPlane near,
 465        FixedPlane far,
 466        FixedPlane left,
 467        FixedPlane right,
 468        FixedPlane top,
 469        FixedPlane bottom)
 3470    {
 3471        _planes[0] = FixedPlane.Normalize(near);
 3472        _planes[1] = FixedPlane.Normalize(far);
 3473        _planes[2] = FixedPlane.Normalize(left);
 3474        _planes[3] = FixedPlane.Normalize(right);
 3475        _planes[4] = FixedPlane.Normalize(top);
 3476        _planes[5] = FixedPlane.Normalize(bottom);
 477
 3478        _matrix = null;
 3479        CreateCorners();
 3480        UpdateBounds();
 3481    }
 482
 483    private void CreatePlanes(Fixed4x4 matrix)
 39484    {
 39485        _planes[0] = FixedPlane.Normalize(new FixedPlane(-matrix.m02, -matrix.m12, -matrix.m22, -matrix.m32));
 39486        _planes[1] = FixedPlane.Normalize(new FixedPlane(matrix.m02 - matrix.m03, matrix.m12 - matrix.m13, matrix.m22 - 
 39487        _planes[2] = FixedPlane.Normalize(new FixedPlane(-matrix.m03 - matrix.m00, -matrix.m13 - matrix.m10, -matrix.m23
 39488        _planes[3] = FixedPlane.Normalize(new FixedPlane(matrix.m00 - matrix.m03, matrix.m10 - matrix.m13, matrix.m20 - 
 39489        _planes[4] = FixedPlane.Normalize(new FixedPlane(matrix.m01 - matrix.m03, matrix.m11 - matrix.m13, matrix.m21 - 
 39490        _planes[5] = FixedPlane.Normalize(new FixedPlane(-matrix.m03 - matrix.m01, -matrix.m13 - matrix.m11, -matrix.m23
 39491    }
 492
 493    private void CreateCorners()
 43494    {
 43495        _corners[0] = IntersectionPoint(_planes[0], _planes[2], _planes[4]);
 43496        _corners[1] = IntersectionPoint(_planes[0], _planes[3], _planes[4]);
 43497        _corners[2] = IntersectionPoint(_planes[0], _planes[3], _planes[5]);
 43498        _corners[3] = IntersectionPoint(_planes[0], _planes[2], _planes[5]);
 43499        _corners[4] = IntersectionPoint(_planes[1], _planes[2], _planes[4]);
 43500        _corners[5] = IntersectionPoint(_planes[1], _planes[3], _planes[4]);
 43501        _corners[6] = IntersectionPoint(_planes[1], _planes[3], _planes[5]);
 43502        _corners[7] = IntersectionPoint(_planes[1], _planes[2], _planes[5]);
 43503    }
 504
 505    private void UpdateBounds()
 43506    {
 43507        Vector3d min = _corners[0];
 43508        Vector3d max = _corners[0];
 509
 688510        for (int i = 1; i < CornerCount; i++)
 301511        {
 301512            min = Vector3d.Min(min, _corners[i]);
 301513            max = Vector3d.Max(max, _corners[i]);
 301514        }
 515
 43516        Min = min;
 43517        Max = max;
 43518    }
 519
 520    private static Vector3d IntersectionPoint(FixedPlane a, FixedPlane b, FixedPlane c)
 344521    {
 344522        Vector3d cross = Vector3d.Cross(b.Normal, c.Normal);
 344523        Fixed64 denominator = Vector3d.Dot(a.Normal, cross);
 524
 344525        if (denominator == Fixed64.Zero)
 0526            throw new InvalidOperationException("Frustum planes do not intersect at a unique point.");
 527
 344528        Vector3d v1 = cross * a.D;
 344529        Vector3d v2 = Vector3d.Cross(c.Normal, a.Normal) * b.D;
 344530        Vector3d v3 = Vector3d.Cross(a.Normal, b.Normal) * c.D;
 531
 344532        return -(v1 + v2 + v3) / denominator;
 344533    }
 534
 535    private bool IsInside(Vector3d point)
 24536    {
 198537        for (int i = 0; i < PlaneCount; i++)
 95538        {
 95539            if (_planes[i].DotCoordinate(point) > Fixed64.Zero)
 20540                return false;
 75541        }
 542
 4543        return true;
 24544    }
 545
 546    private static void UpdateNearestCandidate(
 547        Vector3d point,
 548        Vector3d candidate,
 549        ref Vector3d best,
 550        ref Fixed64 bestDistance)
 80551    {
 80552        Fixed64 candidateDistance = Vector3d.SqrDistance(point, candidate);
 80553        if (candidateDistance >= bestDistance)
 71554            return;
 555
 9556        best = candidate;
 9557        bestDistance = candidateDistance;
 80558    }
 559
 560    private bool IntersectsFrustum(BoundingFrustum other)
 4561    {
 40562        for (int i = 0; i < PlaneCount; i++)
 18563        {
 18564            if (Separates(_planes[i].Normal, _corners, other._corners))
 2565                return false;
 566
 16567            if (Separates(other._planes[i].Normal, _corners, other._corners))
 0568                return false;
 16569        }
 570
 52571        for (int i = 0; i < Edges.Length; i++)
 24572        {
 24573            Vector3d edgeA = _corners[Edges[i].End] - _corners[Edges[i].Start];
 574
 624575            for (int j = 0; j < Edges.Length; j++)
 288576            {
 288577                Vector3d edgeB = other._corners[Edges[j].End] - other._corners[Edges[j].Start];
 288578                Vector3d axis = Vector3d.Cross(edgeA, edgeB);
 579
 288580                if (axis.SqrMagnitude <= Fixed64.Epsilon)
 96581                    continue;
 582
 192583                if (Separates(axis, _corners, other._corners))
 0584                    return false;
 192585            }
 24586        }
 587
 2588        return true;
 4589    }
 590
 591    private static bool Separates(Vector3d axis, Vector3d[] a, Vector3d[] b)
 226592    {
 226593        Project(axis, a, out Fixed64 minA, out Fixed64 maxA);
 226594        Project(axis, b, out Fixed64 minB, out Fixed64 maxB);
 595
 226596        return maxA < minB || maxB < minA;
 226597    }
 598
 599    private static void Project(Vector3d axis, Vector3d[] corners, out Fixed64 min, out Fixed64 max)
 452600    {
 452601        min = Vector3d.Dot(axis, corners[0]);
 452602        max = min;
 603
 7232604        for (int i = 1; i < CornerCount; i++)
 3164605        {
 3164606            Fixed64 projected = Vector3d.Dot(axis, corners[i]);
 3164607            if (projected < min)
 228608                min = projected;
 2936609            else if (projected > max)
 224610                max = projected;
 3164611        }
 452612    }
 613
 614    #endregion
 615
 616    #region Equality
 617
 618    /// <inheritdoc/>
 619    public bool Equals(BoundingFrustum? other)
 10620    {
 10621        if (other == null)
 1622            return false;
 623
 78624        for (int i = 0; i < PlaneCount; i++)
 36625        {
 36626            if (_planes[i] != other._planes[i])
 6627                return false;
 30628        }
 629
 3630        return true;
 10631    }
 632
 633    /// <inheritdoc/>
 2634    public override bool Equals(object? obj) => obj is BoundingFrustum other && Equals(other);
 635
 636    /// <inheritdoc/>
 637    public override int GetHashCode()
 2638    {
 2639        return HashCode.Combine(_planes[0], _planes[1], _planes[2], _planes[3], _planes[4], _planes[5]);
 2640    }
 641
 642    #endregion
 643}

Methods/Properties

.cctor()
.ctor(FixedMathSharp.Fixed4x4)
.ctor(FixedMathSharp.FixedPlane,FixedMathSharp.FixedPlane,FixedMathSharp.FixedPlane,FixedMathSharp.FixedPlane,FixedMathSharp.FixedPlane,FixedMathSharp.FixedPlane)
.ctor(FixedMathSharp.FixedPlane[])
get_HasMatrix()
get_Matrix()
set_Matrix(FixedMathSharp.Fixed4x4)
get_Near()
get_Far()
get_Left()
get_Right()
get_Top()
get_Bottom()
Contains(FixedMathSharp.Vector3d)
Contains(FixedMathSharp.BoundingBox)
Contains(FixedMathSharp.BoundingArea)
Contains(FixedMathSharp.BoundingSphere)
Contains(FixedMathSharp.BoundingFrustum)
Intersects(FixedMathSharp.BoundingBox)
Intersects(FixedMathSharp.BoundingArea)
Intersects(FixedMathSharp.BoundingSphere)
Intersects(FixedMathSharp.BoundingFrustum)
Intersects(FixedMathSharp.FixedRay)
Intersects(FixedMathSharp.FixedPlane)
ClampPoint(FixedMathSharp.Vector3d)
GetCorners()
GetCorners(FixedMathSharp.Vector3d[])
GetPlanes()
GetPlanes(FixedMathSharp.FixedPlane[])
SetMatrix(FixedMathSharp.Fixed4x4)
SetPlanes(FixedMathSharp.FixedPlane[])
SetPlanes(FixedMathSharp.FixedPlane,FixedMathSharp.FixedPlane,FixedMathSharp.FixedPlane,FixedMathSharp.FixedPlane,FixedMathSharp.FixedPlane,FixedMathSharp.FixedPlane)
CreatePlanes(FixedMathSharp.Fixed4x4)
CreateCorners()
UpdateBounds()
IntersectionPoint(FixedMathSharp.FixedPlane,FixedMathSharp.FixedPlane,FixedMathSharp.FixedPlane)
IsInside(FixedMathSharp.Vector3d)
UpdateNearestCandidate(FixedMathSharp.Vector3d,FixedMathSharp.Vector3d,FixedMathSharp.Vector3d&,FixedMathSharp.Fixed64&)
IntersectsFrustum(FixedMathSharp.BoundingFrustum)
Separates(FixedMathSharp.Vector3d,FixedMathSharp.Vector3d[],FixedMathSharp.Vector3d[])
Project(FixedMathSharp.Vector3d,FixedMathSharp.Vector3d[],FixedMathSharp.Fixed64&,FixedMathSharp.Fixed64&)
Equals(FixedMathSharp.BoundingFrustum)
Equals(System.Object)
GetHashCode()