Armatures: Quaternions or matrices?

Tue Feb 08, 2022 5:20 pm

I'm working on overhauling my limb system because I'm trying to replicate an armature akin to Minecraft using actors. An animation to give you an idea.

Currently I'm using quaternions. So far they seem to work but this is without attachments. The moment I do bring in extra limbs... it kinda doesn't work anymore.

Here's all the vectors that are involved.


PosOff,      // Relative position offsets to Master
RelOff,      // Relative position offsets to self - meant to be applied after offsetting to he master

CurAng,      // The current angle, pitch and roll.
AngOff,      // Secondary angle offsets (reset every tic to (0,0,0)
MainAng,   // Primary angle offsets (not reset)

// Misc. Only posted for relevance if needed, but they shouldn't need to be touched since they're only applied after all others are done.
NextAng,   // For spring dampening. Target angles to reach.
VelAng,    // Current velocity of transition to NextAng.
SwingAngDir;// How much to influence the APR as a scalar.

So to be clear, I'm trying to make a system where limbs can have offsets from the master, and then addition offsets for itself which are relative to its own yaw/pitch/roll.

Which would be best to go with? Keep in mind I have very little experience with matrices, so I'd need some code examples. I have Gutamatics already installed so if someone uses that, perhaps that'll make it easier to write the code.