Class AABBProximity
Defines an 'axis-aligned bounding box' proximity.
public class AABBProximity : IAABBProximity, INearestPointProximity, IAttachableProximity<IAttachedAABBProximity>, IProximity, IShapeVolume, ICloneable, IFormattable
- Inheritance
-
AABBProximity
- Implements
-
IShapeVolume
- Inherited Members
- Extension Methods
Constructors
AABBProximity(IAABBProximity)
Create a bounding box from another IAABBProximity.
public AABBProximity(IAABBProximity other)
Parameters
otherIAABBProximity
AABBProximity(in Bounds)
Create a 3D bounding box.
public AABBProximity(in Bounds bounds)
Parameters
boundsBounds
AABBProximity(in Vector2, in Vector2)
Create a 2D bounding box with an infinite height.
public AABBProximity(in Vector2 center, in Vector2 size)
Parameters
centerVector2sizeVector2
AABBProximity(in Vector3, in Vector3)
Create a 3D bounding box.
public AABBProximity(in Vector3 center, in Vector3 size)
Parameters
centerVector3sizeVector3
Properties
Dimensions
The position and dimensions of the bounding box in world space.
public Bounds Dimensions { get; }
Property Value
- Bounds
Remarks
Any size/extents components may be PositiveInfinity.
worldBounds
Axis-aligned bounds of the rectange.
public Bounds worldBounds { get; }
Property Value
- Bounds
Remarks
Equal to Dimensions in this case.
Methods
Clone()
Creates a new object that is a copy of the current instance.
public object Clone()
Returns
- object
A new object that is a copy of this instance.
TestPoint(in Vector2)
Check if a position is within the proximity while ignoring Y position.
public bool TestPoint(in Vector2 position)
Parameters
positionVector2
Returns
TestPoint(in Vector3)
Check if a position is within the proximity.
public bool TestPoint(in Vector3 position)
Parameters
positionVector3
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
ToString(string?, IFormatProvider?)
Formats the value of the current instance using the specified format.
public string ToString(string? format, IFormatProvider? formatProvider)
Parameters
formatstringThe format to use.
-or-
A null reference (Nothingin Visual Basic) to use the default format defined for the type of the IFormattable implementation.formatProviderIFormatProviderThe provider to use to format the value.
-or-
A null reference (Nothingin Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
Returns
- string
The value of the current instance in the specified format.