2D quad structure. More...
#include <quad.h>
Public Member Functions | |
| Quadx () | |
| Constructs a quad. | |
| Quadx (const Quadx< Type > &quad) | |
| Constructs a quad. | |
| Quadx (const Rectx< Type > &rect) | |
| Constructs a quad. | |
| Quadx (const Vec2< Type > &new_p, const Vec2< Type > &new_q, const Vec2< Type > &new_r, const Vec2< Type > &new_s) | |
| Constructs a quad. | |
| Quadx< Type > & | apply_alignment (Origin origin, Type x, Type y) |
| Applies an origin and offset pair to this rectangle. | |
| Vec2< Type > | center () const |
| Returns the center point of the quad. | |
| Rect | get_bounds () const |
| Returns the bounding box of the quad as a Rect. | |
| Type | get_height () const |
| Returns the height of the quad. | |
| Sizex< Type > | get_size () const |
| Returns the size of the rectangle. | |
| Type | get_width () const |
| Returns the width of the quad. | |
| bool | is_inside (const Vec2< Type > &point) const |
| Check if a point is inside or outside the quad. | |
| bool | operator!= (const Quadx< Type > &quad) const |
| Quad != Quad operator. | |
| Quadx< Type > | operator+ (const Quadx< Type > &quad) const |
| Quad + Quad operator. | |
| Quadx< Type > | operator+ (const Vec2< Type > &point) const |
| Quad + Point operator. | |
| Quadx< Type > & | operator+= (const Quadx< Type > &quad) |
| Quad += Quad operator. | |
| Quadx< Type > & | operator+= (const Vec2< Type > &point) |
| Quad += Point operator. | |
| Quadx< Type > | operator- (const Quadx< Type > &quad) const |
| Quad - Quad operator. | |
| Quadx< Type > | operator- (const Vec2< Type > &point) const |
| Quad - Point operator. | |
| Quadx< Type > & | operator-= (const Quadx< Type > &quad) |
| Quad -= Quad operator. | |
| Quadx< Type > & | operator-= (const Vec2< Type > &point) |
| Quad -= Point operator. | |
| bool | operator== (const Quadx< Type > &quad) const |
| Quad == Quad operator. | |
| Quadx< Type > & | rotate (const Vec2< Type > &hotspot, const Angle &angle) |
| Rotates the Quad. | |
| Quadx< Type > & | scale (const Vec2< Type > &hotspot, float sx, float sy) |
| Scale the Quad. | |
| Quadx< Type > & | scale (float sx, float sy) |
| Scale the Quad. | |
Public Attributes | |
| Vec2< Type > | p |
| First Point. | |
| Vec2< Type > | q |
| Second Point. | |
| Vec2< Type > | r |
| Third Point. | |
| Vec2< Type > | s |
| Fourth Point. | |
2D quad structure.
These quads templates are defined for: int (Quad), float (Quadf), double (Quadd)
|
inline |
Constructs a quad.
Referenced by Quadx(), apply_alignment(), operator!=(), operator+(), operator+(), operator+=(), operator+=(), operator-(), operator-(), operator-=(), operator-=(), operator==(), rotate(), scale(), and scale().
|
inline |
|
inline |
Constructs a quad.
| rect | Rectangle used to initialize the quad. |
The corners of the rect are mapped to the quad member variables as follows:
References clan::left, p, q, r, clan::right, and s.
|
inline |
| Quadx< Type > & clan::Quadx< Type >::apply_alignment | ( | Origin | origin, |
| Type | x, | ||
| Type | y ) |
| Vec2< Type > clan::Quadx< Type >::center | ( | ) | const |
Returns the center point of the quad.
| Rect clan::Quadx< Type >::get_bounds | ( | ) | const |
Returns the bounding box of the quad as a Rect.
| Type clan::Quadx< Type >::get_height | ( | ) | const |
Returns the height of the quad.
Referenced by get_size().
|
inline |
Returns the size of the rectangle.
References get_height(), and get_width().
| Type clan::Quadx< Type >::get_width | ( | ) | const |
Returns the width of the quad.
Referenced by get_size().
| bool clan::Quadx< Type >::is_inside | ( | const Vec2< Type > & | point | ) | const |
Check if a point is inside or outside the quad.
References clan::point.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| Quadx< Type > & clan::Quadx< Type >::rotate | ( | const Vec2< Type > & | hotspot, |
| const Angle & | angle ) |
| Quadx< Type > & clan::Quadx< Type >::scale | ( | const Vec2< Type > & | hotspot, |
| float | sx, | ||
| float | sy ) |
| Quadx< Type > & clan::Quadx< Type >::scale | ( | float | sx, |
| float | sy ) |
| Vec2<Type> clan::Quadx< Type >::p |
First Point.
Referenced by Quadx(), Quadx(), Quadx(), Quadx(), operator!=(), operator+(), operator+(), operator+=(), operator+=(), operator-(), operator-(), operator-=(), operator-=(), and operator==().
| Vec2<Type> clan::Quadx< Type >::q |
Second Point.
Referenced by Quadx(), Quadx(), Quadx(), Quadx(), operator!=(), operator+(), operator+(), operator+=(), operator+=(), operator-(), operator-(), operator-=(), operator-=(), and operator==().
| Vec2<Type> clan::Quadx< Type >::r |
Third Point.
Referenced by Quadx(), Quadx(), Quadx(), Quadx(), operator!=(), operator+(), operator+(), operator+=(), operator+=(), operator-(), operator-(), operator-=(), operator-=(), and operator==().
| Vec2<Type> clan::Quadx< Type >::s |
Fourth Point.
Referenced by Quadx(), Quadx(), Quadx(), Quadx(), operator!=(), operator+(), operator+(), operator+=(), operator+=(), operator-(), operator-(), operator-=(), operator-=(), and operator==().