Dualie
Loading...
Searching...
No Matches
dl::Rect< T > Class Template Reference

A class that represents a bounding box. More...

#include <Rect.hpp>

Public Member Functions

 Rect (T left, T top, T width, T height)
 
 Rect (dl::Vector2< T > position, dl::Vector2< T > size)
 
 Rect (const dl::Rect< T > &rect)
 
bool intersects (Rect< T > rect)
 Returns whether a rect intersects the bounds of this rect.
 
bool contains (dl::Vector2< T > point)
 Returns whether a point intersects the bounds of this rect.
 

Public Attributes

left
 
top
 
width
 
height
 

Detailed Description

template<class T>
class dl::Rect< T >

A class that represents a bounding box.

Template Parameters
TThe type of number that its members use

Member Function Documentation

◆ contains()

template<class T >
bool dl::Rect< T >::contains ( dl::Vector2< T > point)
inline

Returns whether a point intersects the bounds of this rect.

Parameters
pointThe point to check
Returns
Whether the point intersects this rect's bounds

◆ intersects()

template<class T >
bool dl::Rect< T >::intersects ( Rect< T > rect)
inline

Returns whether a rect intersects the bounds of this rect.

Parameters
rectThe rect to check
Returns
Whether the rect intersects this rect's bounds

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