pick matrix helper (aka gluPickMatrix)

This commit is contained in:
Recep Aslantas
2021-08-16 16:53:46 +03:00
parent a2bd00df32
commit 8427d02a9b
5 changed files with 63 additions and 0 deletions

View File

@@ -101,4 +101,20 @@ glms_project(vec3s pos, mat4s m, vec4s vp) {
return r;
}
/*!
* @brief define a picking region
*
* @param[in] center center [x, y] of a picking region in window coordinates
* @param[in] size size [width, height] of the picking region in window coordinates
* @param[in] vp viewport as [x, y, width, height]
* @returns projected coordinates
*/
CGLM_INLINE
mat4s
glms_pickmatrix(vec3s center, vec2s size, vec4s vp) {
mat4s res;
glm_pickmatrix(center.raw, size.raw, vp.raw, res.raw);
return res;
}
#endif /* cglms_projects_h */