Support Forum G3D Web Page |
2D oriented box More...
Public Member Functions | |
Box2D (const Vector2 ¢er=Vector2(0, 0), float w=0, float h=0, float angle=0) | |
Box2D (const AABox2D &b) | |
Box2D (const Vector2 &min, const Vector2 &max) | |
Box2D (const CFrame &frame, Box2D &b) | |
Transform b by frame, discarding the Z components, and compute the new box. More... | |
float | area () const |
Surface area. More... | |
const Vector2 & | axis (int a) const |
Unit length vector along axis a. More... | |
const Vector2 & | center () const |
bool | contains (const Vector2 &v) const |
const Vector2 & | corner (int i) const |
const Vector2 & | extent () const |
Distance from corner(0) to the next corner along the box's local axis a. More... | |
bool | overlaps (const Box2D &other) const |
Returns true if the intersection of the boxes is non-empty. More... | |
2D oriented box
G3D::Box2D::Box2D | ( | const Vector2 & | center = Vector2(0, 0) , |
float | w = 0 , |
||
float | h = 0 , |
||
float | angle = 0 |
||
) |
center | World-space center |
w | Width along object-space x-axis |
h | Height along object-space y-axis |
angle | Counter-clockwise angle from object-space x-axis in radians |
G3D::Box2D::Box2D | ( | const AABox2D & | b | ) |
Transform b by frame, discarding the Z components, and compute the new box.
|
inline |
Surface area.
|
inline |
Unit length vector along axis a.
|
inline |
|
inline |
|
inline |
|
inline |
Distance from corner(0) to the next corner along the box's local axis a.
|
inline |
Returns true if the intersection of the boxes is non-empty.