diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-02-14 12:59:07 +0000 | 
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-02-14 12:59:07 +0000 | 
| commit | 9506960a925367b3ac45f8bd7775b3a70cb0baec (patch) | |
| tree | 15c23121a44febc9e27fb64b52bc7467906335cb /utility | |
| parent | Add consts for other compass points (diff) | |
| download | ilt-9506960a925367b3ac45f8bd7775b3a70cb0baec.tar.bz2 ilt-9506960a925367b3ac45f8bd7775b3a70cb0baec.tar.xz ilt-9506960a925367b3ac45f8bd7775b3a70cb0baec.zip | |
Add operator[] to Arc
Diffstat (limited to 'utility')
| -rw-r--r-- | utility/maths.h | 10 | 
1 files changed, 9 insertions, 1 deletions
| diff --git a/utility/maths.h b/utility/maths.h index 22688cb..31f5960 100644 --- a/utility/maths.h +++ b/utility/maths.h @@ -5,7 +5,15 @@  #include <glm/gtc/constants.hpp>  #include <utility> -using Arc = std::pair<float, float>; +struct Arc : public std::pair<float, float> { +	using std::pair<float, float>::pair; + +	float +	operator[](unsigned int i) const +	{ +		return i ? second : first; +	} +};  constexpr const glm::vec3 up {0, 1, 0};  constexpr const glm::vec3 north {0, 0, 1}; | 
