Add static constants to vec4

- Tests, too
This commit is contained in:
Jesse Talavera-Greenberg
2015-10-02 18:34:53 -04:00
parent 25bd7014b0
commit 02b011651b
3 changed files with 103 additions and 0 deletions

View File

@@ -112,6 +112,22 @@ namespace detail
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 Z;
static const type W;
static const type XY;
static const type XZ;
static const type XW;
static const type YZ;
static const type YW;
static const type ZW;
static const type XYZ;
static const type XYW;
static const type XZW;
static const type YZW;
static const type XYZW;
// -- Data --
# if GLM_HAS_ANONYMOUS_UNION && GLM_NOT_BUGGY_VC32BITS

View File

@@ -32,6 +32,70 @@
namespace glm
{
template <typename T, precision P>
const tvec4<T, P> tvec4<T, P>::ZERO =
tvec4<T, P>(static_cast<T>(0), static_cast<T>(0), static_cast<T>(0), static_cast<T>(0));
template <typename T, precision P>
const tvec4<T, P> tvec4<T, P>::X =
tvec4<T, P>(static_cast<T>(1), static_cast<T>(0), static_cast<T>(0), static_cast<T>(0));
template <typename T, precision P>
const tvec4<T, P> tvec4<T, P>::Y =
tvec4<T, P>(static_cast<T>(0), static_cast<T>(1), static_cast<T>(0), static_cast<T>(0));
template <typename T, precision P>
const tvec4<T, P> tvec4<T, P>::Z =
tvec4<T, P>(static_cast<T>(0), static_cast<T>(0), static_cast<T>(1), static_cast<T>(0));
template <typename T, precision P>
const tvec4<T, P> tvec4<T, P>::W =
tvec4<T, P>(static_cast<T>(0), static_cast<T>(0), static_cast<T>(0), static_cast<T>(1));
template <typename T, precision P>
const tvec4<T, P> tvec4<T, P>::XY =
tvec4<T, P>(static_cast<T>(1), static_cast<T>(1), static_cast<T>(0), static_cast<T>(0));
template <typename T, precision P>
const tvec4<T, P> tvec4<T, P>::XZ =
tvec4<T, P>(static_cast<T>(1), static_cast<T>(0), static_cast<T>(1), static_cast<T>(0));
template <typename T, precision P>
const tvec4<T, P> tvec4<T, P>::XW =
tvec4<T, P>(static_cast<T>(1), static_cast<T>(0), static_cast<T>(0), static_cast<T>(1));
template <typename T, precision P>
const tvec4<T, P> tvec4<T, P>::YZ =
tvec4<T, P>(static_cast<T>(0), static_cast<T>(1), static_cast<T>(1), static_cast<T>(0));
template <typename T, precision P>
const tvec4<T, P> tvec4<T, P>::YW =
tvec4<T, P>(static_cast<T>(0), static_cast<T>(1), static_cast<T>(0), static_cast<T>(1));
template <typename T, precision P>
const tvec4<T, P> tvec4<T, P>::ZW =
tvec4<T, P>(static_cast<T>(0), static_cast<T>(0), static_cast<T>(1), static_cast<T>(1));
template <typename T, precision P>
const tvec4<T, P> tvec4<T, P>::XYZ =
tvec4<T, P>(static_cast<T>(1), static_cast<T>(1), static_cast<T>(1), static_cast<T>(0));
template <typename T, precision P>
const tvec4<T, P> tvec4<T, P>::XYW =
tvec4<T, P>(static_cast<T>(1), static_cast<T>(1), static_cast<T>(0), static_cast<T>(1));
template <typename T, precision P>
const tvec4<T, P> tvec4<T, P>::XZW =
tvec4<T, P>(static_cast<T>(1), static_cast<T>(0), static_cast<T>(1), static_cast<T>(1));
template <typename T, precision P>
const tvec4<T, P> tvec4<T, P>::YZW =
tvec4<T, P>(static_cast<T>(0), static_cast<T>(1), static_cast<T>(1), static_cast<T>(1));
template <typename T, precision P>
const tvec4<T, P> tvec4<T, P>::XYZW =
tvec4<T, P>(static_cast<T>(1), static_cast<T>(1), static_cast<T>(1), static_cast<T>(1));
// -- Implicit basic constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)