mirror of
https://github.com/recp/cglm.git
synced 2025-10-03 16:51:35 +00:00
struct: fix glms_persp_move_far
since struct param is copy-by-value, result was noop
This commit is contained in:
@@ -273,22 +273,26 @@ glms_perspective(float fovy, float aspect, float nearZ, float farZ) {
|
||||
/*!
|
||||
* @brief extend perspective projection matrix's far distance
|
||||
*
|
||||
* NOTE: if you dodn't want to create new matrix then use array api on struct.raw
|
||||
* like glm_persp_move_far(prooj.raw, deltaFar) to avoid create new mat4
|
||||
* each time
|
||||
*
|
||||
* this function does not guarantee far >= near, be aware of that!
|
||||
*
|
||||
* @param[in, out] proj projection matrix to extend
|
||||
* @param[in] deltaFar distance from existing far (negative to shink)
|
||||
*/
|
||||
CGLM_INLINE
|
||||
void
|
||||
mat4s
|
||||
glms_persp_move_far(mat4s proj, float deltaFar) {
|
||||
#if CGLM_CONFIG_CLIP_CONTROL == CGLM_CLIP_CONTROL_LH_ZO
|
||||
glms_persp_move_far_lh_zo(proj, deltaFar);
|
||||
return glms_persp_move_far_lh_zo(proj, deltaFar);
|
||||
#elif CGLM_CONFIG_CLIP_CONTROL == CGLM_CLIP_CONTROL_LH_NO
|
||||
glms_persp_move_far_lh_no(proj, deltaFar);
|
||||
return glms_persp_move_far_lh_no(proj, deltaFar);
|
||||
#elif CGLM_CONFIG_CLIP_CONTROL == CGLM_CLIP_CONTROL_RH_ZO
|
||||
glms_persp_move_far_rh_zo(proj, deltaFar);
|
||||
return glms_persp_move_far_rh_zo(proj, deltaFar);
|
||||
#elif CGLM_CONFIG_CLIP_CONTROL == CGLM_CLIP_CONTROL_RH_NO
|
||||
glms_persp_move_far_rh_no(proj, deltaFar);
|
||||
return glms_persp_move_far_rh_no(proj, deltaFar);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -87,15 +87,22 @@ glms_perspective_lh_no(float fovy, float aspect, float nearZ, float farZ) {
|
||||
* with a left-hand coordinate system and a
|
||||
* clip-space of [-1, 1].
|
||||
*
|
||||
* NOTE: if you dodn't want to create new matrix then use array api on struct.raw
|
||||
* like glms_persp_move_far_lh_no(prooj.raw, deltaFar) to avoid create new mat4
|
||||
* each time
|
||||
*
|
||||
* this function does not guarantee far >= near, be aware of that!
|
||||
*
|
||||
* @param[in, out] proj projection matrix to extend
|
||||
* @param[in] deltaFar distance from existing far (negative to shink)
|
||||
*/
|
||||
CGLM_INLINE
|
||||
void
|
||||
mat4s
|
||||
glms_persp_move_far_lh_no(mat4s proj, float deltaFar) {
|
||||
glm_persp_move_far_lh_no(proj.raw, deltaFar);
|
||||
mat4s dest;
|
||||
dest = proj;
|
||||
glm_persp_move_far_lh_no(dest.raw, deltaFar);
|
||||
return dest;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@@ -87,15 +87,22 @@ glms_perspective_lh_zo(float fovy, float aspect, float nearZ, float farZ) {
|
||||
* with a left-hand coordinate system and a
|
||||
* clip-space of [0, 1].
|
||||
*
|
||||
* NOTE: if you dodn't want to create new matrix then use array api on struct.raw
|
||||
* like glms_persp_move_far_lh_zo(prooj.raw, deltaFar) to avoid create new mat4
|
||||
* each time
|
||||
*
|
||||
* this function does not guarantee far >= near, be aware of that!
|
||||
*
|
||||
* @param[in, out] proj projection matrix to extend
|
||||
* @param[in] deltaFar distance from existing far (negative to shink)
|
||||
*/
|
||||
CGLM_INLINE
|
||||
void
|
||||
mat4s
|
||||
glms_persp_move_far_lh_zo(mat4s proj, float deltaFar) {
|
||||
glm_persp_move_far_lh_zo(proj.raw, deltaFar);
|
||||
mat4s dest;
|
||||
dest = proj;
|
||||
glm_persp_move_far_lh_zo(dest.raw, deltaFar);
|
||||
return dest;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@@ -87,15 +87,22 @@ glms_perspective_rh_no(float fovy, float aspect, float nearZ, float farZ) {
|
||||
* with a right-hand coordinate system and a
|
||||
* clip-space of [-1, 1].
|
||||
*
|
||||
* NOTE: if you dodn't want to create new matrix then use array api on struct.raw
|
||||
* like glms_persp_move_far_rh_no(prooj.raw, deltaFar) to avoid create new mat4
|
||||
* each time
|
||||
* s
|
||||
* this function does not guarantee far >= near, be aware of that!
|
||||
*
|
||||
* @param[in, out] proj projection matrix to extend
|
||||
* @param[in] deltaFar distance from existing far (negative to shink)
|
||||
*/
|
||||
CGLM_INLINE
|
||||
void
|
||||
mat4s
|
||||
glms_persp_move_far_rh_no(mat4s proj, float deltaFar) {
|
||||
glm_persp_move_far_rh_no(proj.raw, deltaFar);
|
||||
mat4s dest;
|
||||
dest = proj;
|
||||
glm_persp_move_far_rh_no(dest.raw, deltaFar);
|
||||
return dest;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@@ -87,15 +87,22 @@ glms_perspective_rh_zo(float fovy, float aspect, float nearZ, float farZ) {
|
||||
* with a right-hand coordinate system and a
|
||||
* clip-space of [0, 1].
|
||||
*
|
||||
* NOTE: if you dodn't want to create new matrix then use array api on struct.raw
|
||||
* like glms_persp_move_far_rh_zo(prooj.raw, deltaFar) to avoid create new mat4
|
||||
* each time
|
||||
*
|
||||
* this function does not guarantee far >= near, be aware of that!
|
||||
*
|
||||
* @param[in, out] proj projection matrix to extend
|
||||
* @param[in] deltaFar distance from existing far (negative to shink)
|
||||
*/
|
||||
CGLM_INLINE
|
||||
void
|
||||
mat4s
|
||||
glms_persp_move_far_rh_zo(mat4s proj, float deltaFar) {
|
||||
glm_persp_move_far_rh_zo(proj.raw, deltaFar);
|
||||
mat4s dest;
|
||||
dest = proj;
|
||||
glm_persp_move_far_rh_zo(dest.raw, deltaFar);
|
||||
return dest;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
Reference in New Issue
Block a user