HughPH.Box2D
Organised dotnet bindings for Box2D 3.1.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
Box2D.AABB Struct Reference

An Axis-Aligned Bounding Box. More...

Inherits IEquatable< AABB >.

Public Member Functions

 AABB (Vec2 lowerBound, Vec2 upperBound)
 Constructs an AABB with the given lower and upper bounds.
 
override string ToString ()
 Returns a string representation of the AABB.
 
bool Equals (AABB other)
 Checks if this AABB is equal to another AABB.
 
override bool Equals (object? obj)
 Checks if this AABB is equal to another object.
 
override int GetHashCode ()
 Returns a hash code for this AABB.
 

Static Public Member Functions

static AABB MakeAABB (ReadOnlySpan< Vec2 > points, float radius)
 Compute the bounding box of an array of circles.
 

Public Attributes

Vec2 LowerBound
 The lower bound of the AABB.
 
Vec2 UpperBound
 The upper bound of the AABB.
 

Properties

float Width [get]
 The width of the AABB.
 
float Height [get]
 The height of the AABB.
 

Detailed Description

An Axis-Aligned Bounding Box.

"Axis-Aligned" here means that the box is aligned with the coordinate axes: the sides of the box are parallel to the x and y axes.
The bounding box is defined by two points, the lower bound and upper bound. AABBs are used for broad-phase collision detection. They can also be used to find the shapes that intersect or are within an axis-aligned rectangle.

Constructor & Destructor Documentation

◆ AABB()

Box2D.AABB.AABB ( Vec2  lowerBound,
Vec2  upperBound 
)
inline

Constructs an AABB with the given lower and upper bounds.

Parameters
lowerBoundThe lower bound of the AABB
upperBoundThe upper bound of the AABB

Member Function Documentation

◆ Equals() [1/2]

bool Box2D.AABB.Equals ( AABB  other)

Checks if this AABB is equal to another AABB.

Parameters
otherThe other AABB to compare to
Returns
True if the AABBs are equal, false otherwise

◆ Equals() [2/2]

override bool Box2D.AABB.Equals ( object?  obj)

Checks if this AABB is equal to another object.

Parameters
objThe object to compare to
Returns
True if the object is an AABB and is equal to this AABB, false otherwise

◆ GetHashCode()

override int Box2D.AABB.GetHashCode ( )

Returns a hash code for this AABB.

Returns
A hash code for this AABB

◆ ToString()

override string Box2D.AABB.ToString ( )
inline

Returns a string representation of the AABB.

Returns
A string representation of the AABB

Property Documentation

◆ Height

float Box2D.AABB.Height
get

The height of the AABB.

This is not an editable property. You must modify the lower and upper bounds to change the height.

◆ Width

float Box2D.AABB.Width
get

The width of the AABB.

This is not an editable property. You must modify the lower and upper bounds to change the width.


The documentation for this struct was generated from the following file: