mirror of
https://github.com/g-truc/glm.git
synced 2024-11-10 04:31:47 +00:00
Added C++11 initalizer lists to quaternions
This commit is contained in:
parent
2d5724e23a
commit
258361ccd4
@ -77,6 +77,11 @@ namespace detail
|
||||
T const & y,
|
||||
T const & z);
|
||||
|
||||
#if(GLM_HAS_INITIALIZER_LISTS)
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tquat(std::initializer_list<U> l);
|
||||
#endif//GLM_HAS_INITIALIZER_LISTS
|
||||
|
||||
// Convertions
|
||||
|
||||
/// Create a quaternion from two normalized axis
|
||||
|
@ -83,6 +83,19 @@ namespace detail
|
||||
w(w)
|
||||
{}
|
||||
|
||||
#if(GLM_HAS_INITIALIZER_LISTS)
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(std::initializer_list<U> l) :
|
||||
x(static_cast<T>(l.begin()[0])),
|
||||
y(static_cast<T>(l.begin()[1])),
|
||||
z(static_cast<T>(l.begin()[2])),
|
||||
w(static_cast<T>(l.begin()[3]))
|
||||
{
|
||||
assert(v.size() >= this->length());
|
||||
}
|
||||
#endif//GLM_HAS_INITIALIZER_LISTS
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// tquat conversions
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user