46 template<
typename Type>
60 :
p(new_p),
q(new_q),
r(new_r),
s(new_s) {}
74 r(rect.
right, rect.bottom),
s(rect.
left, rect.bottom) {}
84 p += quad.
p;
q += quad.
q;
r += quad.
r;
s += quad.
s;
return *
this;
90 p -= quad.
p;
q -= quad.
q;
r -= quad.
r;
s -= quad.
s;
return *
this;
108 return Quadx(
p + quad.
p,
q + quad.
q,
r + quad.
r,
s + quad.
s);
114 return Quadx(
p - quad.
p,
q - quad.
q,
r - quad.
r,
s - quad.
s);
132 return (
p == quad.
p &&
q == quad.
q &&
r == quad.
r &&
s == quad.
s);
138 return (
p != quad.
p ||
q != quad.
q ||
r != quad.
r ||
s != quad.
s);
Quadx< Type > & rotate(const Vec2< Type > &hotspot, const Angle &angle)
Rotates the Quad.
Vec2< Type > p
First Point.
Definition: quad.h:142
2D (left,top,right,bottom) rectangle structure - Double
Definition: rect.h:517
Vec2< Type > r
Third Point.
Definition: quad.h:148
Quadd()
Definition: quad.h:229
2D quad structure - Double
Definition: quad.h:226
Angle class.
Definition: angle.h:59
Quadx< Type > & scale(float sx, float sy)
Scale the Quad.
Origin
Alignment origins.
Definition: origin.h:38
Quadf(const Vec2< float > &new_p, const Vec2< float > &new_q, const Vec2< float > &new_r, const Vec2< float > &new_s)
Definition: quad.h:220
Rect get_bounds() const
Returns the bounding box of the quad as a Rect.
Quadf(const Quadx< float > &quad)
Definition: quad.h:222
Quad(const Rect &rect)
Definition: quad.h:211
Quadx< Type > & operator+=(const Quadx< Type > &quad)
Quad += Quad operator.
Definition: quad.h:82
Vec2< Type > s
Fourth Point.
Definition: quad.h:151
Quadx< Type > & operator-=(const Vec2< Type > &point)
Quad -= Point operator.
Definition: quad.h:100
Type get_height() const
Returns the height of the quad.
Sizex< Type > get_size() const
Returns the size of the rectangle.
Definition: quad.h:160
Type get_width() const
Returns the width of the quad.
Quadx(const Quadx< Type > &quad)
Constructs a quad.
Definition: quad.h:79
2D (left,top,right,bottom) rectangle structure - Integer
Definition: rect.h:488
Quad(const Vec2< int > &new_p, const Vec2< int > &new_q, const Vec2< int > &new_r, const Vec2< int > &new_s)
Definition: quad.h:210
Quadx< Type > & operator-=(const Quadx< Type > &quad)
Quad -= Quad operator.
Definition: quad.h:88
Vec2< Type > q
Second Point.
Definition: quad.h:145
Quadd(const Quadx< double > &quad)
Definition: quad.h:232
2D (left,top,right,bottom) rectangle structure - Float
Definition: rect.h:502
2D quad structure - Float
Definition: quad.h:216
Quadx(const Vec2< Type > &new_p, const Vec2< Type > &new_q, const Vec2< Type > &new_r, const Vec2< Type > &new_s)
Constructs a quad.
Definition: quad.h:59
2D quad structure - Integer
Definition: quad.h:206
Vec2< Type > center() const
Returns the center point of the quad.
bool operator!=(const Quadx< Type > &quad) const
Quad != Quad operator.
Definition: quad.h:136
Quad()
Definition: quad.h:209
bool operator==(const Quadx< Type > &quad) const
Quad == Quad operator.
Definition: quad.h:130
Quadx< Type > operator+(const Vec2< Type > &point) const
Quad + Point operator.
Definition: quad.h:118
Quadf()
Definition: quad.h:219
2D vector
Definition: line.h:46
Quad(const Quadx< int > &quad)
Definition: quad.h:212
Quadx< Type > operator+(const Quadx< Type > &quad) const
Quad + Quad operator.
Definition: quad.h:106
2D (left,top,right,bottom) rectangle structure.
Definition: line.h:43
2D quad structure.
Definition: quad.h:47
Quadd(const Vec2< double > &new_p, const Vec2< double > &new_q, const Vec2< double > &new_r, const Vec2< double > &new_s)
Definition: quad.h:230
Quadx< Type > operator-(const Vec2< Type > &point) const
Quad - Point operator.
Definition: quad.h:124
bool is_inside(const Vec2< Type > &point) const
Check if a point is inside or outside the quad.
Quadf(const Rectf &rect)
Definition: quad.h:221
Quadx< Type > & operator+=(const Vec2< Type > &point)
Quad += Point operator.
Definition: quad.h:94
Quadx< Type > & apply_alignment(Origin origin, Type x, Type y)
Applies an origin and offset pair to this rectangle.
Quadx()
Constructs a quad.
Definition: quad.h:51
Quadx(const Rectx< Type > &rect)
Constructs a quad.
Definition: quad.h:73
Quadx< Type > operator-(const Quadx< Type > &quad) const
Quad - Quad operator.
Definition: quad.h:112
Quadd(const Rectd &rect)
Definition: quad.h:231
2D (width,height) size structure.
Definition: size.h:54