mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +00:00
glm_lerpc(), glm_step(), glm_smoothstep(), glm_smoothinterp() (#98)
* lerp, step, smoothstep * glm_lerp() and friends are no longer clamped, use glm_lerpc() and friends * mix() function as wrapper of lerp() * no there are clamp and raw version of lerp functions
This commit is contained in:
committed by
Recep Aslantas
parent
43b36f1dc1
commit
4639f3184a
@@ -33,6 +33,7 @@
|
||||
CGLM_INLINE mat3s glms_quat_mat3(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_lerpc(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 versors glms_quat_for(vec3s dir, vec3s fwd, vec3s up)
|
||||
@@ -372,7 +373,7 @@ glms_quat_mat3t(versors q) {
|
||||
*
|
||||
* @param[in] from from
|
||||
* @param[in] to to
|
||||
* @param[in] t interpolant (amount) clamped between 0 and 1
|
||||
* @param[in] t interpolant (amount)
|
||||
* @returns result quaternion
|
||||
*/
|
||||
CGLM_INLINE
|
||||
@@ -383,6 +384,23 @@ glms_quat_lerp(versors from, versors to, float t) {
|
||||
return dest;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief interpolates between two quaternions
|
||||
* using linear interpolation (LERP)
|
||||
*
|
||||
* @param[in] from from
|
||||
* @param[in] to to
|
||||
* @param[in] t interpolant (amount) clamped between 0 and 1
|
||||
* @returns result quaternion
|
||||
*/
|
||||
CGLM_INLINE
|
||||
versors
|
||||
glms_quat_lerpc(versors from, versors to, float t) {
|
||||
versors dest;
|
||||
glm_quat_lerpc(from.raw, to.raw, t, dest.raw);
|
||||
return dest;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief interpolates between two quaternions
|
||||
* using spherical linear interpolation (SLERP)
|
||||
|
||||
Reference in New Issue
Block a user