SA_Maths
Sapphire Suite's C++ Maths Library
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
SA::Rect2D< T > Struct Template Reference

Rectangle2D Sapphire's class. More...

#include <Rectangle2D.hpp>

Public Member Functions

 Rect2D ()=default
 Default constructor.
 
 Rect2D (const Vec2< T > &_offset, const Vec2< T > &_extent) noexcept
 Constructor from offset and extent.
 
 Rect2D (T _x, T _y, T _width, T _height) noexcept
 Constructor from (x, y) (offset) and (width, height) (extent).
 

Public Attributes

union { 
 
   Vec2< T >   offset = Vec2<T>() 
 offset.
 
   struct { 
 
      T   x 
 alias for offset.x
 
      T   y 
 alias for offset.y
 
   }  
 
};  
 
union { 
 
   Vec2< T >   extent = Vec2<T>() 
 extents.
 
   struct { 
 
      T   width 
 alias for extent.x
 
      T   height 
 alias for extent.y
 
   }  
 
};  
 

Detailed Description

template<typename T>
struct SA::Rect2D< T >

Rectangle2D Sapphire's class.

Template Parameters
TType of the rectangle..

Constructor & Destructor Documentation

◆ Rect2D() [1/2]

template<typename T >
SA::Rect2D< T >::Rect2D ( const Vec2< T > & _offset,
const Vec2< T > & _extent )
inlinenoexcept

Constructor from offset and extent.

Parameters
_offsetOffset
_extentExtent

◆ Rect2D() [2/2]

template<typename T >
SA::Rect2D< T >::Rect2D ( T _x,
T _y,
T _width,
T _height )
inlinenoexcept

Constructor from (x, y) (offset) and (width, height) (extent).

Parameters
_xX offset value.
_yY offset value
_widthWidth extent value.
_heightHeight extent value.

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