quat_interpolate(3alleg4)

πŸ’« quat_interpolate β€” the Allegro manual, but make it make sense πŸ’«

okay bestie, gather round, because we're talking about quat_interpolate from the Allegro game programming library, and honestly? she's a little icon. 🌸


✨ NAME ✨

quat_interpolate β€” builds you a quaternion that reps a rotation sitting somewhere between from and to. it's giving Allegro game programming library, no cap. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <allegro.h>

void quat_interpolate(const QUAT *from, const QUAT *to, float t, QUAT
*out);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea πŸ«– β€” this function constructs a quaternion that represents a rotation between from and to.

that t argument? she can be anything between 0 and 1, and she tells you where between from and to your result is gonna land:

  • 0 β†’ returns from
  • 1 β†’ returns to
  • 0.5 β†’ returns a rotation that's exactly in between ✨

the result gets copied into out. and the best part, lowkey the main character move: this function will create the short rotation (less than 180 degrees) between from and to. slay. πŸ‘‘

ngl, that short-rotation thing is the whole vibe β€” she's not gonna take the long way around the sphere, periodt.

πŸ‘€ SEE ALSO πŸ‘€


that's the whole page bestie, go forth and interpolate responsibly πŸ’–

Allegro Β· version 4.4.3 Β· written on the day of quat_interpolate(3alleg4) 🌈 β€” mwah, ily, bye πŸŽ€πŸ’