stmm-games-doc  0.32.0
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
stmg::NRect Struct Reference

Public Member Functions

bool containsPoint (NPoint oP) const noexcept
 
NSize getSize () const noexcept
 

Static Public Member Functions

static bool doIntersect (NRect oR1, NRect oR2) noexcept
 Whether two rectangles intersect. More...
 
static NRect intersectionRect (NRect oR1, NRect oR2) noexcept
 The maximal rectangle contained by two rectangles. More...
 
static NRect boundingRect (NRect oR1, NRect oR2) noexcept
 The minimal rectangle containing two rectangles. More...
 

Public Attributes

int32_t m_nX = 0
 Default is 0. More...
 
int32_t m_nY = 0
 Default is 0. More...
 
int32_t m_nW = 0
 Default is 0. More...
 
int32_t m_nH = 0
 Default is 0. More...
 

Member Function Documentation

◆ boundingRect()

static NRect stmg::NRect::boundingRect ( NRect  oR1,
NRect  oR2 
)
staticnoexcept

The minimal rectangle containing two rectangles.

Parameters
oR1Must have positive size.
oR2Must have positive size.
Returns
Bounding rectangle.

◆ containsPoint()

bool stmg::NRect::containsPoint ( NPoint  oP) const
inlinenoexcept

◆ doIntersect()

static bool stmg::NRect::doIntersect ( NRect  oR1,
NRect  oR2 
)
staticnoexcept

Whether two rectangles intersect.

Parameters
oR1Must have positive size.
oR2Must have positive size.
Returns
Whether intersect.

◆ getSize()

NSize stmg::NRect::getSize ( ) const
inlinenoexcept

◆ intersectionRect()

static NRect stmg::NRect::intersectionRect ( NRect  oR1,
NRect  oR2 
)
staticnoexcept

The maximal rectangle contained by two rectangles.

Parameters
oR1Must have positive size.
oR2Must have positive size.
Returns
Intersection rectangle or 0 size rectangle if rectangles don't intersect.

Member Data Documentation

◆ m_nH

int32_t stmg::NRect::m_nH = 0

Default is 0.

◆ m_nW

int32_t stmg::NRect::m_nW = 0

Default is 0.

◆ m_nX

int32_t stmg::NRect::m_nX = 0

Default is 0.

◆ m_nY

int32_t stmg::NRect::m_nY = 0

Default is 0.