Struct FixedBoundFrustum
- Namespace
- FixedMathSharp.Geometry
- Assembly
- FixedMathSharp.dll
Represents a frustum bounded by six clipping planes.
public struct FixedBoundFrustum : IEquatable<FixedBoundFrustum>
- Implements
- Inherited Members
Constructors
FixedBoundFrustum(Fixed4x4)
Initializes a new frustum by extracting the planes and corners from a combined view-projection matrix.
public FixedBoundFrustum(Fixed4x4 matrix)
Parameters
matrixFixed4x4
FixedBoundFrustum(FixedPlane, FixedPlane, FixedPlane, FixedPlane, FixedPlane, FixedPlane)
Initializes a new frustum from six clipping planes.
public FixedBoundFrustum(FixedPlane near, FixedPlane far, FixedPlane left, FixedPlane right, FixedPlane top, FixedPlane bottom)
Parameters
nearFixedPlanefarFixedPlaneleftFixedPlanerightFixedPlanetopFixedPlanebottomFixedPlane
FixedBoundFrustum(FixedPlane[])
Initializes a new frustum from six clipping planes in near, far, left, right, top, bottom order.
public FixedBoundFrustum(FixedPlane[] planes)
Parameters
planesFixedPlane[]
Fields
CornerCount
The number of corner points in a frustum.
public const int CornerCount = 8
Field Value
PlaneCount
The number of planes in a frustum.
public const int PlaneCount = 6
Field Value
Properties
Bottom
Gets the bottom clipping plane.
public FixedPlane Bottom { get; }
Property Value
Far
Gets the far clipping plane.
public FixedPlane Far { get; }
Property Value
HasMatrix
Gets a value indicating whether this frustum was created from a matrix source.
public bool HasMatrix { get; }
Property Value
Left
Gets the left clipping plane.
public FixedPlane Left { get; }
Property Value
Matrix
Gets or sets the matrix source used to define this frustum.
public Fixed4x4 Matrix { get; set; }
Property Value
Exceptions
- InvalidOperationException
Thrown when reading the matrix from a frustum that was created from planes.
Max
Gets the maximum corner of the axis-aligned box that encloses the frustum.
public readonly Vector3d Max { get; }
Property Value
Min
Gets the minimum corner of the axis-aligned box that encloses the frustum.
public readonly Vector3d Min { get; }
Property Value
Near
Gets the near clipping plane.
public FixedPlane Near { get; }
Property Value
Right
Gets the right clipping plane.
public FixedPlane Right { get; }
Property Value
Top
Gets the top clipping plane.
public FixedPlane Top { get; }
Property Value
Methods
ClampPoint(Vector3d)
Clamps a point to this frustum, returning the point unchanged when it is already inside.
public Vector3d ClampPoint(Vector3d point)
Parameters
pointVector3d
Returns
Contains(FixedBoundBox)
Tests a bounding box against this frustum.
public FixedEnclosureType Contains(FixedBoundBox box)
Parameters
boxFixedBoundBox
Returns
Contains(FixedBoundFrustum)
Tests another frustum against this frustum.
public FixedEnclosureType Contains(FixedBoundFrustum frustum)
Parameters
frustumFixedBoundFrustum
Returns
Contains(FixedBoundSphere)
Tests a bounding sphere against this frustum.
public FixedEnclosureType Contains(FixedBoundSphere sphere)
Parameters
sphereFixedBoundSphere
Returns
Contains(Vector3d)
Tests a point against this frustum.
public FixedEnclosureType Contains(Vector3d point)
Parameters
pointVector3d
Returns
Equals(FixedBoundFrustum)
public bool Equals(FixedBoundFrustum other)
Parameters
otherFixedBoundFrustum
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetCorner(int)
Gets the corner at the specified stable index without allocating.
public Vector3d GetCorner(int index)
Parameters
indexint
Returns
GetCorners()
Returns a copy of the frustum corner array.
public Vector3d[] GetCorners()
Returns
- Vector3d[]
GetCorners(Vector3d[])
Copies this frustum's corners into the specified array.
public void GetCorners(Vector3d[] corners)
Parameters
cornersVector3d[]
GetHashCode()
public override int GetHashCode()
Returns
GetPlane(int)
Gets the plane at the specified stable index in near, far, left, right, top, bottom order without allocating.
public FixedPlane GetPlane(int index)
Parameters
indexint
Returns
GetPlanes()
Returns a copy of the frustum plane array in near, far, left, right, top, bottom order.
public FixedPlane[] GetPlanes()
Returns
GetPlanes(FixedPlane[])
Copies this frustum's planes into the specified array in near, far, left, right, top, bottom order.
public void GetPlanes(FixedPlane[] planes)
Parameters
planesFixedPlane[]
Intersects(FixedBoundBox)
Checks whether a bounding box intersects this frustum.
public bool Intersects(FixedBoundBox box)
Parameters
boxFixedBoundBox
Returns
Intersects(FixedBoundFrustum)
Checks whether another frustum intersects this frustum.
public bool Intersects(FixedBoundFrustum frustum)
Parameters
frustumFixedBoundFrustum
Returns
Intersects(FixedBoundSphere)
Checks whether a bounding sphere intersects this frustum.
public bool Intersects(FixedBoundSphere sphere)
Parameters
sphereFixedBoundSphere
Returns
Intersects(FixedPlane)
Classifies this frustum relative to a plane.
public FixedPlaneIntersectionType Intersects(FixedPlane plane)
Parameters
planeFixedPlane
Returns
Intersects(FixedRay)
Finds the first forward intersection between the specified ray and this frustum.
public Fixed64? Intersects(FixedRay ray)
Parameters
rayFixedRay