C++ Java Unity
C++ Reference
Obb2D Class Reference

Detailed Description

A 2D oriented bounding box.

Public Member Functions

 Obb2D ()
 Constructor. More...
 
 Obb2D (const Obb2D &other)
 Copy constructor. More...
 
 Obb2D (const Vec2F &nCenter, const Vec2F &nHalfExtents, float nRotation)
 Construct from center, half extents and rotation. More...
 
virtual const Vec2FgetCenter () const
 Get the center of the bounding box. More...
 
virtual const Vec2FgetHalfExtents () const
 Get the half width and half height of the bounding box. More...
 
virtual float getRotation () const
 Get the rotation angle of the box. More...
 
virtual ~Obb2D ()
 

Protected Attributes

Vec2F center
 
Vec2F halfExtents
 
float rotation
 

Constructor & Destructor Documentation

Obb2D ( )

Constructor.

Obb2D ( const Obb2D other)

Copy constructor.

Obb2D ( const Vec2F nCenter,
const Vec2F nHalfExtents,
float  nRotation 
)

Construct from center, half extents and rotation.

Parameters
nCenterThe center of the box.
nHalfExtentsThe half width and half height of the (unrotated) box
nRotationCounter-clock-wise rotation angle with respect to the X axis, in radians.
virtual ~Obb2D ( )
virtual

Member Function Documentation

virtual const Vec2F& getCenter ( ) const
virtual

Get the center of the bounding box.

virtual const Vec2F& getHalfExtents ( ) const
virtual

Get the half width and half height of the bounding box.

virtual float getRotation ( ) const
virtual

Get the rotation angle of the box.

Returns
the counter-clock-wise rotation angle of the bounding box, in radians

Member Data Documentation

Vec2F center
protected
Vec2F halfExtents
protected
float rotation
protected