Gamedev Framework (gf)  0.8.0
A C++14 framework for 2D games
Public Member Functions | Protected Attributes | List of all members
gf::TriangleRef< T > Class Template Reference

A reference to a triangle (three points) More...

#include <gf/Triangulation.h>

Public Member Functions

 TriangleRef (T &p0, T &p1, T &p2)
 Constructor with two points. More...
 
const Toperator[] (std::size_t index) const
 Access the points of the triangle. More...
 
Toperator[] (std::size_t index)
 Access the points of the triangle. More...
 

Protected Attributes

Tm_points [3]
 

Detailed Description

template<typename T>
class gf::TriangleRef< T >

A reference to a triangle (three points)

Constructor & Destructor Documentation

◆ TriangleRef()

template<typename T >
gf::TriangleRef< T >::TriangleRef ( T p0,
T p1,
T p2 
)
inline

Constructor with two points.

The address of the points must not change while the triangle is alive.

Parameters
p0The first point
p1The second point
p2The third point

Member Function Documentation

◆ operator[]() [1/2]

template<typename T >
const T& gf::TriangleRef< T >::operator[] ( std::size_t  index) const
inline

Access the points of the triangle.

Parameters
indexThe index of the point ( \( 0 \) or \( 1 \) or \( 2 \))

◆ operator[]() [2/2]

template<typename T >
T& gf::TriangleRef< T >::operator[] ( std::size_t  index)
inline

Access the points of the triangle.

Parameters
indexThe index of the point ( \( 0 \) or \( 1 \) or \( 2 \))

Member Data Documentation

◆ m_points

template<typename T >
T* gf::TriangleRef< T >::m_points[3]
protected