apply_quat(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

✨ apply_quat ✨

okay so bestie, welcome to another iconic page from the Allegro manual β€” this one's apply_quat(3), and it's giving "multiply a point by a quaternion" energy πŸ’… fr fr.


🌸 NAME 🌸

apply_quat β€” multiplies a point by a quaternion. Part of the Allegro game programming library, periodt πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <allegro.h>

void apply_quat(const QUAT *q, float x, y, z, *xout, *yout, *zout);

πŸ’– DESCRIPTION πŸ’–

So here's the vibe: you take the point (x, y, z), you multiply it by the quaternion q, and the result lands all cozy in (*xout, *yout, *zout). Slay ✨

But ngl, lowkey important heads-up: this is quite a bit slower than apply_matrix_f(). So only use it to translate a few points, okay? Like, a few. Not a whole army of them 😭

If you've got many points to get through, it's much more efficient to call quat_to_matrix() first and then hit apply_matrix_f(). That's the move. Trust. πŸ”₯


🫢 reminder: a few points = apply_quat. many points = quat_to_matrix() + apply_matrix_f(). iykyk πŸ’œ

and that's the whole page, bestie β€” no cap 🧚 from the Allegro manual, version 4.4.3, dated right there alongside apply_quat(3). mwah, go multiply something cute πŸŒˆπŸ’–

πŸ“¦ where this page comes from