Axis-Aligned Bounding Box.
    public struct AABB : IEquatable<AABB>

AABB consists of a position, a size, and several utility functions. It is typically used for fast overlap tests.

Inheritance Chain

Interfaces

Constructors

    public AABB(Vector3 position, Vector3 size)

Optional constructor, accepts position and size.

    public AABB()

Properties

    public Vector3 End { get; }

Ending corner.

    public Vector3 Position { get; }

Beginning corner.

    public Vector3 Size { get; }

Size from position to end.

Methods

    public bool Encloses(AABB with)

Returns true if this AABB completely encloses another one.

    public override bool Equals(object obj)

    public bool Equals(AABB other)

    public AABB Expand(Vector3 to_point)

Returns this AABB expanded to include a given point.

    public float GetArea()

Gets the area of the AABB.

    public Vector3 GetEndpoint(int idx)

Gets the position of the 8 endpoints of the AABB in space.

    public override int GetHashCode()

    public Vector3 GetLongestAxis()

Returns the normalized longest axis of the AABB.

    public Vector3.Axis GetLongestAxisIndex()

Returns the index of the longest axis of the AABB (according to Vector3::AXIS* enum).

    public float GetLongestAxisSize()

Returns the scalar length of the longest axis of the AABB.

    public Vector3 GetShortestAxis()

Returns the normalized shortest axis of the AABB.

    public Vector3.Axis GetShortestAxisIndex()

Returns the index of the shortest axis of the AABB (according to Vector3::AXIS* enum).

    public float GetShortestAxisSize()

Returns the scalar length of the shortest axis of the AABB.

    public Vector3 GetSupport(Vector3 dir)

Returns the support point in a given direction. This is useful for collision detection algorithms.

    public AABB Grow(float by)

Returns a copy of the AABB grown a given amount of units towards all the sides.

    public bool HasNoArea()

Returns true if the AABB is flat or empty.

    public bool HasNoSurface()

Returns true if the AABB is empty.

    public bool HasPoint(Vector3 point)

Returns true if the AABB contains a point.

    public AABB Intersection(AABB with)

Returns the intersection between two AABB. An empty AABB (size 0,0,0) is returned on failure.

    public bool Intersects(AABB with)

Returns true if the AABB overlaps with another.

    public bool IntersectsPlane(Plane plane)

Returns true if the AABB is on both sides of a plane.

    public bool IntersectsSegment(Vector3 from, Vector3 to)

Returns true if the AABB intersects the line segment between from and to.

    public AABB Merge(AABB with)

Returns a larger AABB that contains this AABB and with.

    public override string ToString()

    public string ToString(string format)

Operators

    public static bool operator ==(AABB left, AABB right)

    public static bool operator !=(AABB left, AABB right)
Tags: