2D quad structure - Float More...

#include <quad.h>

+ Inheritance diagram for clan::Quadf:

Public Member Functions

 Quadf ()
 
 Quadf (const Vec2< float > &new_p, const Vec2< float > &new_q, const Vec2< float > &new_r, const Vec2< float > &new_s)
 
 Quadf (const Rectf &rect)
 
 Quadf (const Quadx< float > &quad)
 
Construction
Quadx< float > & operator+= (const Quadx< float > &quad)
 Quad += Quad operator. More...
 
Quadx< float > & operator+= (const Vec2< float > &point)
 Quad += Point operator. More...
 
Quadx< float > & operator-= (const Quadx< float > &quad)
 Quad -= Quad operator. More...
 
Quadx< float > & operator-= (const Vec2< float > &point)
 Quad -= Point operator. More...
 
Quadx< float > operator+ (const Quadx< float > &quad) const
 Quad + Quad operator. More...
 
Quadx< float > operator+ (const Vec2< float > &point) const
 Quad + Point operator. More...
 
Quadx< float > operator- (const Quadx< float > &quad) const
 Quad - Quad operator. More...
 
Quadx< float > operator- (const Vec2< float > &point) const
 Quad - Point operator. More...
 
bool operator== (const Quadx< float > &quad) const
 Quad == Quad operator. More...
 
bool operator!= (const Quadx< float > &quad) const
 Quad != Quad operator. More...
 
Operations
Quadx< float > & rotate (const Vec2< float > &hotspot, const Angle &angle)
 Rotates the Quad. More...
 
Quadx< float > & scale (float sx, float sy)
 Scale the Quad. More...
 
Quadx< float > & scale (const Vec2< float > &hotspot, float sx, float sy)
 Scale the Quad. More...
 
Vec2< float > center () const
 Returns the center point of the quad. More...
 
Quadx< float > & apply_alignment (Origin origin, floatx, floaty)
 Applies an origin and offset pair to this rectangle. More...
 
bool is_inside (const Vec2< float > &point) const
 Check if a point is inside or outside the quad. More...
 

Attributes

float get_width () const
 Returns the width of the quad. More...
 
float get_height () const
 Returns the height of the quad. More...
 
Sizex< float > get_size () const
 Returns the size of the rectangle. More...
 
Rect get_bounds () const
 Returns the bounding box of the quad as a Rect. More...
 
Vec2< float > p
 First Point. More...
 
Vec2< float > q
 Second Point. More...
 
Vec2< float > r
 Third Point. More...
 
Vec2< float > s
 Fourth Point. More...
 

Detailed Description

2D quad structure - Float

Member Function Documentation

Quadx<float >& clan::Quadx< float >::apply_alignment ( Origin  origin,
float  x,
float  y 
)
inherited

Applies an origin and offset pair to this rectangle.

Parameters
originThe new origin to adjust to from default upper-left position
x,yOffsets applied negatively to each corner of the rectangle
Returns
reference to this object
Vec2<float > clan::Quadx< float >::center ( ) const
inherited

Returns the center point of the quad.

Rect clan::Quadx< float >::get_bounds ( ) const
inherited

Returns the bounding box of the quad as a Rect.

float clan::Quadx< float >::get_height ( ) const
inherited

Returns the height of the quad.

Sizex<float > clan::Quadx< float >::get_size ( ) const
inlineinherited

Returns the size of the rectangle.

float clan::Quadx< float >::get_width ( ) const
inherited

Returns the width of the quad.

bool clan::Quadx< float >::is_inside ( const Vec2< float > &  point) const
inherited

Check if a point is inside or outside the quad.

bool clan::Quadx< float >::operator!= ( const Quadx< float > &  quad) const
inlineinherited

Quad != Quad operator.

Quadx<float > clan::Quadx< float >::operator+ ( const Quadx< float > &  quad) const
inlineinherited

Quad + Quad operator.

Quadx<float > clan::Quadx< float >::operator+ ( const Vec2< float > &  point) const
inlineinherited

Quad + Point operator.

Quadx<float >& clan::Quadx< float >::operator+= ( const Quadx< float > &  quad)
inlineinherited

Quad += Quad operator.

Quadx<float >& clan::Quadx< float >::operator+= ( const Vec2< float > &  point)
inlineinherited

Quad += Point operator.

Quadx<float > clan::Quadx< float >::operator- ( const Quadx< float > &  quad) const
inlineinherited

Quad - Quad operator.

Quadx<float > clan::Quadx< float >::operator- ( const Vec2< float > &  point) const
inlineinherited

Quad - Point operator.

Quadx<float >& clan::Quadx< float >::operator-= ( const Quadx< float > &  quad)
inlineinherited

Quad -= Quad operator.

Quadx<float >& clan::Quadx< float >::operator-= ( const Vec2< float > &  point)
inlineinherited

Quad -= Point operator.

bool clan::Quadx< float >::operator== ( const Quadx< float > &  quad) const
inlineinherited

Quad == Quad operator.

Quadx<float >& clan::Quadx< float >::rotate ( const Vec2< float > &  hotspot,
const Angle angle 
)
inherited

Rotates the Quad.

Parameters
hotspotPoint to rotate around.
angleAngle to rotate in degrees.
Returns
reference to this object
Quadx<float >& clan::Quadx< float >::scale ( float  sx,
float  sy 
)
inherited

Scale the Quad.

Parameters
sx= Scale value in x-axis
sy= Scale value in y-axis
Returns
reference to this object
Quadx<float >& clan::Quadx< float >::scale ( const Vec2< float > &  hotspot,
float  sx,
float  sy 
)
inherited

Scale the Quad.

Parameters
sx= Scale value in x-axis
sy= Scale value in y-axis
hotspot= Point to scale around.
Returns
reference to this object

Member Data Documentation

Vec2<float > clan::Quadx< float >::p
inherited

First Point.

Vec2<float > clan::Quadx< float >::q
inherited

Second Point.

Vec2<float > clan::Quadx< float >::r
inherited

Third Point.

Vec2<float > clan::Quadx< float >::s
inherited

Fourth Point.


The documentation for this class was generated from the following file: