mirror of
https://github.com/recp/cglm.git
synced 2025-10-04 09:08:53 +00:00
Add struct API wrapper
This commit is contained in:
@@ -34,6 +34,7 @@
|
|||||||
CGLM_INLINE mat3s glms_quat_mat3t(versors q)
|
CGLM_INLINE mat3s glms_quat_mat3t(versors q)
|
||||||
CGLM_INLINE versors glms_quat_lerp(versors from, versors to, float t)
|
CGLM_INLINE versors glms_quat_lerp(versors from, versors to, float t)
|
||||||
CGLM_INLINE versors glms_quat_lerpc(versors from, versors to, float t)
|
CGLM_INLINE versors glms_quat_lerpc(versors from, versors to, float t)
|
||||||
|
CGLM_INLINE versors glms_quat_nlerp(versors from, versors to, float t)
|
||||||
CGLM_INLINE versors glms_quat_slerp(versors from, versors to, float t)
|
CGLM_INLINE versors glms_quat_slerp(versors from, versors to, float t)
|
||||||
CGLM_INLINE mat4s. glms_quat_look(vec3s eye, versors ori)
|
CGLM_INLINE mat4s. glms_quat_look(vec3s eye, versors ori)
|
||||||
CGLM_INLINE versors glms_quat_for(vec3s dir, vec3s fwd, vec3s up)
|
CGLM_INLINE versors glms_quat_for(vec3s dir, vec3s fwd, vec3s up)
|
||||||
@@ -401,6 +402,24 @@ glms_quat_lerpc(versors from, versors to, float t) {
|
|||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief interpolates between two quaternions
|
||||||
|
* taking the shortest rotation path using
|
||||||
|
* normalized linear interpolation (NLERP)
|
||||||
|
*
|
||||||
|
* @param[in] from from
|
||||||
|
* @param[in] to to
|
||||||
|
* @param[in] t interpolant (amount)
|
||||||
|
* @param[out] dest result quaternion
|
||||||
|
*/
|
||||||
|
CGLM_INLINE
|
||||||
|
versors
|
||||||
|
glms_quat_nlerp(versors from, versors to, float t) {
|
||||||
|
versors dest;
|
||||||
|
glm_quat_nlerp(from.raw, to.raw, t, dest.raw);
|
||||||
|
return dest;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief interpolates between two quaternions
|
* @brief interpolates between two quaternions
|
||||||
* using spherical linear interpolation (SLERP)
|
* using spherical linear interpolation (SLERP)
|
||||||
|
Reference in New Issue
Block a user