Add static constants for vec2

- Tests, too
This commit is contained in:
Jesse Talavera-Greenberg
2015-10-02 18:33:14 -04:00
parent b8ff59a61b
commit b42a46d246
3 changed files with 27 additions and 0 deletions

View File

@@ -58,6 +58,10 @@ namespace glm
static GLM_RELAXED_CONSTEXPR precision prec = P;
# endif//GLM_META_PROG_HELPERS
static const type ZERO;
static const type X;
static const type Y;
static const type XY;
// -- Data --
# if GLM_HAS_ANONYMOUS_UNION

View File

@@ -28,6 +28,17 @@
namespace glm
{
template <typename T, precision P>
const tvec2<T, P> tvec2<T, P>::ZERO = tvec2<T, P>(static_cast<T>(0), static_cast<T>(0));
template <typename T, precision P>
const tvec2<T, P> tvec2<T, P>::X = tvec2<T, P>(static_cast<T>(1), static_cast<T>(0));
template <typename T, precision P>
const tvec2<T, P> tvec2<T, P>::Y = tvec2<T, P>(static_cast<T>(0), static_cast<T>(1));
template <typename T, precision P>
const tvec2<T, P> tvec2<T, P>::XY = tvec2<T, P>(static_cast<T>(1), static_cast<T>(1));
// -- Implicit basic constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)