Table of Contents

Struct AabbF

Namespace
TileWorld.Engine.Core.Math
Assembly
TileWorld.Engine.dll

Represents an axis-aligned floating-point rectangle.

public readonly record struct AabbF : IEquatable<AabbF>
Implements
Inherited Members

Constructors

AabbF(float, float, float, float)

Represents an axis-aligned floating-point rectangle.

public AabbF(float X, float Y, float Width, float Height)

Parameters

X float
Y float
Width float
Height float

Properties

Bottom

Gets the maximum Y coordinate.

public float Bottom { get; }

Property Value

float

Height

public float Height { get; init; }

Property Value

float

Left

Gets the minimum X coordinate.

public float Left { get; }

Property Value

float

Right

Gets the maximum X coordinate.

public float Right { get; }

Property Value

float

Top

Gets the minimum Y coordinate.

public float Top { get; }

Property Value

float

Width

public float Width { get; init; }

Property Value

float

X

public float X { get; init; }

Property Value

float

Y

public float Y { get; init; }

Property Value

float

Methods

Intersects(AabbF)

Returns whether this rectangle intersects another rectangle.

public bool Intersects(AabbF other)

Parameters

other AabbF

The rectangle to test.

Returns

bool

true when the rectangles overlap.

Translate(Float2)

Returns a copy translated by the supplied offset.

public AabbF Translate(Float2 offset)

Parameters

offset Float2

The offset to apply.

Returns

AabbF

The translated rectangle.