Table of Contents

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

min Vector2

The min

max Vector2

The max

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

min Vector2

The min

max Vector2

The max

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

center Vector2

The center

width float

The width

height float

The height

Fields

LowerBound

The lower vertex

public Vector2 LowerBound

Field Value

Vector2

UpperBound

The upper vertex

public Vector2 UpperBound

Field Value

Vector2

Properties

Center

Get the center of the AABB.

public Vector2 Center { get; }

Property Value

Vector2

Extents

Get the extents of the AABB (half-widths).

public Vector2 Extents { get; }

Property Value

Vector2

Height

Gets the value of the height

public float Height { get; }

Property Value

float

Perimeter

Get the perimeter length

public float Perimeter { get; }

Property Value

float

Q1

First quadrant

public AABB Q1 { get; }

Property Value

AABB

Q2

Second quadrant

public AABB Q2 { get; }

Property Value

AABB

Q3

Third quadrant

public AABB Q3 { get; }

Property Value

AABB

Q4

Forth quadrant

public AABB Q4 { get; }

Property Value

AABB

Vertices

Gets the vertices of the AABB.

public Vertices Vertices { get; }

Property Value

Vertices

Width

Gets the value of the width

public float Width { get; }

Property Value

float

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

aabb1 AABB

The aabb1.

aabb2 AABB

The aabb2.

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

a AABB

The first AABB.

b AABB

The second AABB.

Returns

bool

True if they are overlapping.