Struct AABB
- Namespace
- Alis.Core.Physic.Collision
- Assembly
- Alis.dll
An axis aligned bounding box.
public struct AABB
Inherited Members
Constructors
AABB(Vector2, Vector2)
Initializes a new instance of the Alis.Core.Physic.Collision.AABB class
public AABB(Vector2 min, Vector2 max)
Parameters
AABB(ref Vector2, ref Vector2)
Initializes a new instance of the Alis.Core.Physic.Collision.AABB class
public AABB(ref Vector2 min, ref Vector2 max)
Parameters
AABB(Vector2, float, float)
Initializes a new instance of the Alis.Core.Physic.Collision.AABB class
public AABB(Vector2 center, float width, float height)
Parameters
Fields
LowerBound
The lower vertex
public Vector2 LowerBound
Field Value
UpperBound
The upper vertex
public Vector2 UpperBound
Field Value
Properties
Center
Get the center of the AABB.
public Vector2 Center { get; }
Property Value
Extents
Get the extents of the AABB (half-widths).
public Vector2 Extents { get; }
Property Value
Height
Gets the value of the height
public float Height { get; }
Property Value
Perimeter
Get the perimeter length
public float Perimeter { get; }
Property Value
Q1
First quadrant
public AABB Q1 { get; }
Property Value
Q2
Second quadrant
public AABB Q2 { get; }
Property Value
Q3
Third quadrant
public AABB Q3 { get; }
Property Value
Q4
Forth quadrant
public AABB Q4 { get; }
Property Value
Vertices
Gets the vertices of the AABB.
public Vertices Vertices { get; }
Property Value
Width
Gets the value of the width
public float Width { get; }
Property Value
Methods
Combine(ref AABB)
Combine an AABB into this one.
public void Combine(ref AABB aabb)
Parameters
aabb
AABB-
The aabb.
Combine(ref AABB, ref AABB)
Combine two AABBs into this one.
public void Combine(ref AABB aabb1, ref AABB aabb2)
Parameters
Contains(ref AABB)
Does this aabb contain the provided AABB.
public bool Contains(ref AABB aabb)
Parameters
aabb
AABB-
The aabb.
Returns
- bool
-
true
if it contains the specified aabb; otherwise,false
.
Contains(ref Vector2)
Determines whether the AAABB contains the specified point.
public bool Contains(ref Vector2 point)
Parameters
point
Vector2-
The point.
Returns
- bool
-
true
if it contains the specified point; otherwise,false
.
IsValid()
Verify that the bounds are sorted. And the bounds are valid numbers (not NaN).
public bool IsValid()
Returns
- bool
-
true
if this instance is valid; otherwise,false
.
RayCast(out RayCastOutput, ref RayCastInput, bool)
Raycast against this AABB using the specificed points and maxfraction (found in input)
public bool RayCast(out RayCastOutput output, ref RayCastInput input, bool doInteriorCheck = true)
Parameters
output
RayCastOutput-
The results of the raycast.
input
RayCastInput-
The parameters for the raycast.
doInteriorCheck
bool
Returns
- bool
-
True if the ray intersects the AABB
TestOverlap(ref AABB, ref AABB)
Test if the two AABBs overlap.
public static bool TestOverlap(ref AABB a, ref AABB b)
Parameters
Returns
- bool
-
True if they are overlapping.