mirror of
https://github.com/recp/cglm.git
synced 2025-10-04 17:09:40 +00:00
add missing spin impl
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
CGLM_INLINE void glm_rotate(mat4 m, float angle, vec3 axis);
|
CGLM_INLINE void glm_rotate(mat4 m, float angle, vec3 axis);
|
||||||
CGLM_INLINE void glm_rotate_at(mat4 m, vec3 pivot, float angle, vec3 axis);
|
CGLM_INLINE void glm_rotate_at(mat4 m, vec3 pivot, float angle, vec3 axis);
|
||||||
CGLM_INLINE void glm_rotate_atm(mat4 m, vec3 pivot, float angle, vec3 axis);
|
CGLM_INLINE void glm_rotate_atm(mat4 m, vec3 pivot, float angle, vec3 axis);
|
||||||
|
CGLM_INLINE void glm_spin(mat4 m, float angle, vec3 axis);
|
||||||
CGLM_INLINE void glm_decompose_scalev(mat4 m, vec3 s);
|
CGLM_INLINE void glm_decompose_scalev(mat4 m, vec3 s);
|
||||||
CGLM_INLINE bool glm_uniscaled(mat4 m);
|
CGLM_INLINE bool glm_uniscaled(mat4 m);
|
||||||
CGLM_INLINE void glm_decompose_rs(mat4 m, mat4 r, vec3 s);
|
CGLM_INLINE void glm_decompose_rs(mat4 m, mat4 r, vec3 s);
|
||||||
|
@@ -81,6 +81,10 @@ CGLM_EXPORT
|
|||||||
void
|
void
|
||||||
glmc_rotate_atm(mat4 m, vec3 pivot, float angle, vec3 axis);
|
glmc_rotate_atm(mat4 m, vec3 pivot, float angle, vec3 axis);
|
||||||
|
|
||||||
|
CGLM_EXPORT
|
||||||
|
void
|
||||||
|
glmc_spin(mat4 m, float angle, vec3 axis);
|
||||||
|
|
||||||
CGLM_EXPORT
|
CGLM_EXPORT
|
||||||
void
|
void
|
||||||
glmc_decompose_scalev(mat4 m, vec3 s);
|
glmc_decompose_scalev(mat4 m, vec3 s);
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
CGLM_INLINE mat4s glms_rotate(mat4s m, float angle, vec3s axis);
|
CGLM_INLINE mat4s glms_rotate(mat4s m, float angle, vec3s axis);
|
||||||
CGLM_INLINE mat4s glms_rotate_at(mat4s m, vec3s pivot, float angle, vec3s axis);
|
CGLM_INLINE mat4s glms_rotate_at(mat4s m, vec3s pivot, float angle, vec3s axis);
|
||||||
CGLM_INLINE mat4s glms_rotate_atm(mat4s m, vec3s pivot, float angle, vec3s axis);
|
CGLM_INLINE mat4s glms_rotate_atm(mat4s m, vec3s pivot, float angle, vec3s axis);
|
||||||
|
CGLM_INLINE mat4s glms_spin(mat4s m, float angle, vec3s axis);
|
||||||
CGLM_INLINE vec3s glms_decompose_scalev(mat4s m);
|
CGLM_INLINE vec3s glms_decompose_scalev(mat4s m);
|
||||||
CGLM_INLINE bool glms_uniscaled(mat4s m);
|
CGLM_INLINE bool glms_uniscaled(mat4s m);
|
||||||
CGLM_INLINE void glms_decompose_rs(mat4s m, mat4s * r, vec3s * s);
|
CGLM_INLINE void glms_decompose_rs(mat4s m, mat4s * r, vec3s * s);
|
||||||
@@ -273,6 +274,21 @@ glms_rotate_atm(mat4s m, vec3s pivot, float angle, vec3s axis) {
|
|||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief rotate existing transform matrix around given axis by angle around self (doesn't affected by position)
|
||||||
|
*
|
||||||
|
* @param[in] m affine transfrom
|
||||||
|
* @param[in] angle angle (radians)
|
||||||
|
* @param[in] axis axis
|
||||||
|
* @returns affine transfrom
|
||||||
|
*/
|
||||||
|
CGLM_INLINE
|
||||||
|
mat4s
|
||||||
|
glms_spin(mat4s m, float angle, vec3s axis) {
|
||||||
|
glm_spin(m.raw, angle, axis.raw);
|
||||||
|
return m;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief decompose scale vector
|
* @brief decompose scale vector
|
||||||
*
|
*
|
||||||
|
@@ -110,6 +110,12 @@ glmc_rotate_atm(mat4 m, vec3 pivot, float angle, vec3 axis) {
|
|||||||
glm_rotate_atm(m, pivot, angle, axis);
|
glm_rotate_atm(m, pivot, angle, axis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CGLM_EXPORT
|
||||||
|
void
|
||||||
|
glmc_spin(mat4 m, float angle, vec3 axis) {
|
||||||
|
glm_spin(m, angle, axis);
|
||||||
|
}
|
||||||
|
|
||||||
CGLM_EXPORT
|
CGLM_EXPORT
|
||||||
void
|
void
|
||||||
glmc_decompose_scalev(mat4 m, vec3 s) {
|
glmc_decompose_scalev(mat4 m, vec3 s) {
|
||||||
|
Reference in New Issue
Block a user