get_x_rotate_quat(3alleg4)

πŸ’« get_x_rotate_quat β€” bestie edition πŸ’«

okay so this is a page from the Allegro manual, and it's about making quaternions that spin stuff around an axis. three lil functions, one big vibe. let's go πŸŽ€


✨ NAME ✨

get_x_rotate_quat, get_y_rotate_quat, get_z_rotate_quat β€” bestie, these construct axis rotation quaternions. they live in the Allegro game programming library. πŸ‘‘


🌸 SYNOPSIS 🌸

#include <allegro.h>

void get_x_rotate_quat(QUAT *q, float r);

void get_y_rotate_quat(QUAT *q, float r);

void get_z_rotate_quat(QUAT *q, float r);

like… look at them. three little icons. one job. 🫢


πŸ’… DESCRIPTION πŸ’…

So here's the tea: these three build axis rotation quaternions and stash them in q. that's it, that's the whole thing, and honestly? it ate. πŸ’–

when you apply one of these quaternions to a point, it rotates that point about the relevant axis by the angle you handed it. and the angle is in binary, 256 degrees to a circle format β€” not your regular degrees, not radians, it's giving very specific. 256 degrees to a circle, periodt. 🌈

so get_x_rotate_quat does the X axis, get_y_rotate_quat does the Y axis, get_z_rotate_quat does the Z axis. each one takes your QUAT *q and your float r and does its lil thing. no cap. πŸ”₯

heads up bestie: that angle format is 256 degrees to a circle, fr fr. if you roll up in here with regular 360-degree angles your rotation is gonna be doing its own thing and you will be confused. πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

ngl there's no SEE ALSO section on this page, so go touch some grass or go read the rest of the Allegro docs, your call πŸ’œ


and that's the whole page!! mwah πŸ’‹ this was written by the Allegro crew, from version 4.4.3 of the Allegro manual, and the page itself is dated like the rest of the 4.4.3 era docs. slay, bye bestie πŸŽ€βœ¨πŸ’–