GA::kit v0.3
G&A's in-house C++ application framework
Loading...
Searching...
No Matches
ga::Rect Struct Reference

A 2D axis-aligned rectangle, with x,y (float) position and w,h (float) size components.
More...

#include <math.h>

Public Member Functions

 Rect ()
 
 Rect (float xPos, float yPos, float width, float height)
 
 Rect (const vec2 &ptA, const vec2 &ptB)
 
vec2 position () const
 
vec2 size () const
 
float area () const
 
vec2 min () const
 
vec2 max () const
 
bool contains (const vec2 &pt) const
 

Public Attributes

float x
 
float y
 
float w
 
float h
 

Detailed Description

A 2D axis-aligned rectangle, with x,y (float) position and w,h (float) size components.

The x,y position components are the "principle point" of the rectangle. The w,h components are added to the x,y point to find the 3 other corners.

Constructor & Destructor Documentation

◆ Rect() [1/3]

ga::Rect::Rect ( )
inline

◆ Rect() [2/3]

ga::Rect::Rect ( float  xPos,
float  yPos,
float  width,
float  height 
)
inline

◆ Rect() [3/3]

ga::Rect::Rect ( const vec2 &  ptA,
const vec2 &  ptB 
)
inline

Member Function Documentation

◆ area()

float ga::Rect::area ( ) const
inline

◆ contains()

bool ga::Rect::contains ( const vec2 &  pt) const
inline

◆ max()

vec2 ga::Rect::max ( ) const
inline

◆ min()

vec2 ga::Rect::min ( ) const
inline

◆ position()

vec2 ga::Rect::position ( ) const
inline

◆ size()

vec2 ga::Rect::size ( ) const
inline

Member Data Documentation

◆ h

float ga::Rect::h

◆ w

float ga::Rect::w

◆ x

float ga::Rect::x

◆ y

float ga::Rect::y

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