mirror of
https://github.com/g-truc/glm.git
synced 2024-11-16 23:04:35 +00:00
Add static xpos, xneg, ypos, etc constants to tvec3 as requested in issue #21.
I've also included corresponding right, left, up, down, backward and forward constants. The z coordinate for 'forward' is set to -1, as one would expect with OpenGL.
This commit is contained in:
parent
ac59f0e4c5
commit
1af1bea837
@ -244,6 +244,24 @@ namespace detail
|
|||||||
GLM_FUNC_DECL tvec4<T> swizzle(comp X, comp Y, comp Z, comp W) const;
|
GLM_FUNC_DECL tvec4<T> swizzle(comp X, comp Y, comp Z, comp W) const;
|
||||||
GLM_FUNC_DECL tref2<T> swizzle(comp X, comp Y);
|
GLM_FUNC_DECL tref2<T> swizzle(comp X, comp Y);
|
||||||
GLM_FUNC_DECL tref3<T> swizzle(comp X, comp Y, comp Z);
|
GLM_FUNC_DECL tref3<T> swizzle(comp X, comp Y, comp Z);
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////////////////////
|
||||||
|
// Static constants
|
||||||
|
|
||||||
|
static const tvec3<T> xpos;
|
||||||
|
static const tvec3<T> xneg;
|
||||||
|
static const tvec3<T> ypos;
|
||||||
|
static const tvec3<T> yneg;
|
||||||
|
static const tvec3<T> zpos;
|
||||||
|
static const tvec3<T> zneg;
|
||||||
|
|
||||||
|
static const tvec3<T> right;
|
||||||
|
static const tvec3<T> left;
|
||||||
|
static const tvec3<T> up;
|
||||||
|
static const tvec3<T> down;
|
||||||
|
static const tvec3<T> backward;
|
||||||
|
static const tvec3<T> forward;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
@ -1148,5 +1148,25 @@ namespace detail
|
|||||||
return tvec3<T>(this->x, this->y, this->z);
|
return tvec3<T>(this->x, this->y, this->z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////////////////////
|
||||||
|
// Static constants
|
||||||
|
|
||||||
|
template <typename T> const tvec3<T> tvec3<T>::xpos = tvec3<T>(T( 1), T( 0), T (0));
|
||||||
|
template <typename T> const tvec3<T> tvec3<T>::xneg = tvec3<T>(T(-1), T( 0), T( 0));
|
||||||
|
template <typename T> const tvec3<T> tvec3<T>::ypos = tvec3<T>(T( 0), T( 1), T( 0));
|
||||||
|
template <typename T> const tvec3<T> tvec3<T>::yneg = tvec3<T>(T( 0), T(-1), T( 0));
|
||||||
|
template <typename T> const tvec3<T> tvec3<T>::zpos = tvec3<T>(T( 0), T( 0), T( 1));
|
||||||
|
template <typename T> const tvec3<T> tvec3<T>::zneg = tvec3<T>(T( 0), T( 0), T(-1));
|
||||||
|
|
||||||
|
template <typename T> const tvec3<T> tvec3<T>::right = tvec3<T>(T( 1), T( 0), T( 0));
|
||||||
|
template <typename T> const tvec3<T> tvec3<T>::left = tvec3<T>(T(-1), T( 0), T( 0));
|
||||||
|
template <typename T> const tvec3<T> tvec3<T>::up = tvec3<T>(T( 0), T( 1), T( 0));
|
||||||
|
template <typename T> const tvec3<T> tvec3<T>::down = tvec3<T>(T( 0), T(-1), T( 0));
|
||||||
|
template <typename T> const tvec3<T> tvec3<T>::backward = tvec3<T>(T( 0), T( 0), T( 1));
|
||||||
|
template <typename T> const tvec3<T> tvec3<T>::forward = tvec3<T>(T( 0), T( 0), T(-1));
|
||||||
|
|
||||||
|
|
||||||
}//namespace detail
|
}//namespace detail
|
||||||
}//namespace glm
|
}//namespace glm
|
||||||
|
Loading…
Reference in New Issue
Block a user