NAME
Box2D::b2AABB - An axis aligned bounding box.
SYNOPSIS
my $aabb = Box2D::b2AABB->new();
$aabb->lowerBound( Box2D::b2Vec2->new( $x1, $y1 ) );
$aabb->upperBound( Box2D::b2Vec2->new( $x2, $y2 ) );
$aabb->Combine( $aabb1, $aabb2 );
my $center = $aabb->GetCenter();
my $extents = $aabb->GetExtents();
my $input = Box2D::b2RayCastInput->new();
my $output = Box2D::b2RayCastOutput->new();
$aabb->RayCast( $output, $input );
DESCRIPTION
An axis aligned bounding box.
METHODS
new()
Default constructor.
Returns a Box2D::b2AABB
Combine( $aabb1, $aabb2 )
Combine two AABBs into this one.
Parameters:
Box2D::b2AABB
$aabb1
Box2D::b2AABB
$aabb2
Contains( $aabb )
Does this aabb contain the provided AABB.
Parameters:
Box2D::b2AABB
$aabb
Returns a bool
GetCenter()
Get the center of the AABB.
Returns a Box2D::b2Vec2
GetExtents()
Get the extents of the AABB (half-widths).
Returns a Box2D::b2Vec2
IsValid()
Verify that the bounds are sorted.
Returns a bool
RayCast( $output, $input )
Parameters:
Box2D::b2RayCastOutput
$output
Box2D::b2RayCastInput
$input
Returns a bool
lowerBound()
lowerBound( $lowerBound )
the lower vertex
Parameters:
Box2D::b2Vec2
$lowerBound
(optional)
Returns a Box2D::b2Vec2
upperBound()
upperBound( $upperBound )
the upper vertex
Parameters:
Box2D::b2Vec2
$upperBound
(optional)
Returns a Box2D::b2Vec2
SEE ALSO
BUGS
See "BUGS" in Box2D