I am working on a custom engine and have been tinkering with animations using the Cal3D library. My previous experience with animations was based on prototyping a bit with Unity's Mecanim.
Right now, I'm trying to implement a character that can be idle, walk or run and is also able to point it's gun straight, up or down while doing any of the previous animations. As far as I know, this would require two different variables from which to calculate the weights of each animation, these are, the aiming angle and the speed of the player.
At first I thought about separating the hands and head of the player as a partial animation and do a 1DBlender (like the one in Unity) based on the aiming angle to interpolate between three different animations of the arms and head pointing up, straight or down. Then, for the rest of the body, interpolate with another 1DBlender based on the speed. While the solution works, I'm still not completely okay with it, as I cannot have blended animations for the arms and head based not only on the aiming angle but also on the speed (which would allo me to have things like having the head of the character slightly bobbing while pointing down and running and then having the head mostly still while idle).
My idea was to try to implement something similar to one of the 2DBlenders found in unity in such a way that I could have 9 animations (IdlePointingDown, IdlePointingUp, IdlePointingStraight, WalkingPointingUp, ...) and calculate the weight for each animations based on the two variables I have. The issue is that I don't have any idea on how to implement such blender. Could anybody give me any tips on what the pseudocode or general idea would be like, or recommend me a different solution?
Thank you very much.