- Added right and left handed projection and clip control support #447 #119

This commit is contained in:
Christophe Riccio 2016-03-06 00:16:09 +01:00
parent 45d18796e3
commit fe18a36c10
2 changed files with 11 additions and 0 deletions

View File

@ -578,7 +578,12 @@ namespace glm
tmp = proj * tmp; tmp = proj * tmp;
tmp /= tmp.w; tmp /= tmp.w;
#ifdef GLM_DEPTH_ZERO_TO_ONE
tmp.x = tmp.x * T(0.5) + T(0.5);
tmp.y = tmp.y * T(0.5) + T(0.5);
#else
tmp = tmp * T(0.5) + T(0.5); tmp = tmp * T(0.5) + T(0.5);
#endif
tmp[0] = tmp[0] * T(viewport[2]) + T(viewport[0]); tmp[0] = tmp[0] * T(viewport[2]) + T(viewport[0]);
tmp[1] = tmp[1] * T(viewport[3]) + T(viewport[1]); tmp[1] = tmp[1] * T(viewport[3]) + T(viewport[1]);
@ -599,7 +604,12 @@ namespace glm
tvec4<T, P> tmp = tvec4<T, P>(win, T(1)); tvec4<T, P> tmp = tvec4<T, P>(win, T(1));
tmp.x = (tmp.x - T(viewport[0])) / T(viewport[2]); tmp.x = (tmp.x - T(viewport[0])) / T(viewport[2]);
tmp.y = (tmp.y - T(viewport[1])) / T(viewport[3]); tmp.y = (tmp.y - T(viewport[1])) / T(viewport[3]);
#ifdef GLM_DEPTH_ZERO_TO_ONE
tmp.x = tmp.x * T(2) - T(1);
tmp.y = tmp.y * T(2) - T(1);
#else
tmp = tmp * T(2) - T(1); tmp = tmp * T(2) - T(1);
#endif
tvec4<T, P> obj = Inverse * tmp; tvec4<T, P> obj = Inverse * tmp;
obj /= obj.w; obj /= obj.w;

View File

@ -53,6 +53,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate)
#### [GLM 0.9.8.0](https://github.com/g-truc/glm/releases/latest) - 2016-XX-XX #### [GLM 0.9.8.0](https://github.com/g-truc/glm/releases/latest) - 2016-XX-XX
##### Features: ##### Features:
- Added right and left handed projection and clip control support #447 #119
- Added compNormalize and compScale functions to GTX_component_wise - Added compNormalize and compScale functions to GTX_component_wise
- Added packF3x9_E1x5 and unpackF3x9_E1x5 to GTC_packing for RGB9E5 #416 - Added packF3x9_E1x5 and unpackF3x9_E1x5 to GTC_packing for RGB9E5 #416
- Added (un)packHalf to GTC_packing - Added (un)packHalf to GTC_packing