Jeffrey T. Palmer > Box2D > Box2D::b2AABB

Download:
Box2D-0.07.tar.gz

Annotate this POD

View/Report Bugs
Source  

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:

Contains( $aabb )

Does this aabb contain the provided AABB.

Parameters:

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:

Returns a bool

lowerBound()

lowerBound( $lowerBound )

the lower vertex

Parameters:

Returns a Box2D::b2Vec2

upperBound()

upperBound( $upperBound )

the upper vertex

Parameters:

Returns a Box2D::b2Vec2

SEE ALSO ^

BUGS ^

See "BUGS" in Box2D

AUTHORS ^

See "AUTHORS" in Box2D

COPYRIGHT & LICENSE ^

See "COPYRIGHT & LICENSE" in Box2D

syntax highlighting: