jGL
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
jGL::BoundingBox< T > Struct Template Reference

A bounding box template. More...

#include <primitive.h>

Public Member Functions

 BoundingBox ()
 
 BoundingBox (const std::array< glm::tvec2< T >, 4 > &v)
 
bool in (T x, T y)
 If the point (x, y) is in the box.
 

Public Attributes

std::array< glm::tvec2< T >, 4 > vertices
 Vertices of bounding box.
 

Detailed Description

template<class T>
struct jGL::BoundingBox< T >

A bounding box template.

Remarks
See WorldBoundingBox and ScreenBoundingBox typedefs

Constructor & Destructor Documentation

◆ BoundingBox() [1/2]

template<class T >
jGL::BoundingBox< T >::BoundingBox ( )
inline

◆ BoundingBox() [2/2]

template<class T >
jGL::BoundingBox< T >::BoundingBox ( const std::array< glm::tvec2< T >, 4 > &  v)
inline

Member Function Documentation

◆ in()

template<class T >
bool jGL::BoundingBox< T >::in ( x,
y 
)
inline

If the point (x, y) is in the box.

Parameters
xPoint x coordinate.
yPoint y coordinate.
Returns
true (x, y) is in the box.
false (x, y) is not in the box.
Remarks
static_cast<float>s (x, y) for checking.

Member Data Documentation

◆ vertices

template<class T >
std::array<glm::tvec2<T>, 4> jGL::BoundingBox< T >::vertices

Vertices of bounding box.

Remarks
Assumed in anti-clockwise order, e.g. Sprite::getWorldBoundingBox

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