Skip to content

Commit

Permalink
- Added right and left handed projection and clip control support #447
Browse files Browse the repository at this point in the history
  • Loading branch information
Groovounet committed Mar 5, 2016
1 parent 45d1879 commit fe18a36
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions glm/gtc/matrix_transform.inl
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,12 @@ namespace glm
tmp = proj * tmp;

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);
#endif
tmp[0] = tmp[0] * T(viewport[2]) + T(viewport[0]);
tmp[1] = tmp[1] * T(viewport[3]) + T(viewport[1]);

Expand All @@ -599,7 +604,12 @@ namespace glm
tvec4<T, P> tmp = tvec4<T, P>(win, T(1));
tmp.x = (tmp.x - T(viewport[0])) / T(viewport[2]);
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);
#endif

tvec4<T, P> obj = Inverse * tmp;
obj /= obj.w;
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
##### Features:
- Added right and left handed projection and clip control support #447 #119
- Added compNormalize and compScale functions to GTX_component_wise
- Added packF3x9_E1x5 and unpackF3x9_E1x5 to GTC_packing for RGB9E5 #416
- Added (un)packHalf to GTC_packing
Expand Down

0 comments on commit fe18a36

Please sign in to comment.