Class AttachedAABBProximity
An axis-aligned bounding box attached to a transform. Scale, position, and rotation are applied.
public class AttachedAABBProximity : IAttachedAABBProximity, IAABBProximity, INearestPointProximity, IAttachableProximity<IAttachedAABBProximity>, IAttachedProximity, IProximity, IShapeVolume, ICloneable, IFormattable
- Inheritance
-
AttachedAABBProximity
- Implements
-
IShapeVolume
- Inherited Members
- Extension Methods
Constructors
AttachedAABBProximity(Transform, IAABBProximity)
Create an axis-aligned bounding box from another IAABBProximity attached to attachmentRoot.
public AttachedAABBProximity(Transform attachmentRoot, IAABBProximity aabb)
Parameters
attachmentRootTransformaabbIAABBProximity
AttachedAABBProximity(Transform, in Bounds)
Create a 3D bounding box attached to attachmentRoot.
public AttachedAABBProximity(Transform attachmentRoot, in Bounds bounds)
Parameters
attachmentRootTransformboundsBounds
AttachedAABBProximity(Transform, in Vector2, in Vector2)
Create a 2D bounding box with an infinite height attached to attachmentRoot.
public AttachedAABBProximity(Transform attachmentRoot, in Vector2 center, in Vector2 size)
Parameters
attachmentRootTransformcenterVector2sizeVector2
AttachedAABBProximity(Transform, in Vector3, in Vector3)
Create an axis-aligned bounding box attached to attachmentRoot.
public AttachedAABBProximity(Transform attachmentRoot, in Vector3 center, in Vector3 size)
Parameters
attachmentRootTransformcenterVector3sizeVector3
Properties
AttachmentRoot
The transform this proximity is attached to.
public Transform? AttachmentRoot { get; }
Property Value
- Transform
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.