That would definitely work and do what I want (until, perhaps, it comes to making multiple animations, but that's yet a step away), but it seems to be a messy way to do it: it requires making 16 different classes (in my case, anyway) when it seems to me that one ought to suffice (having a generic bone class, and simply being able to modify the data that's used to calculate the rotation angles).
Perhaps I come from too dynamic of a programming background and that's spoiled me.
Is it perhaps possible, then, to have an Animate interface with different classes for different animations, and to have my Bone object contain some object that implements Animate? That solution may work best (since I can keep an array of objects for animation and choose which I want, depending if I want the character to run, or walk, or dance, or whatever).
Well, I know how to make an interface and a class that implements it... but I suppose what I'm wondering is how do I make a class contain *some* object that implements that interface?
Code:
interface foo {
void animate (...);
}
class femurFoo implements foo {
...
}
class spineFoo implements foo {
...
}
class bone {
float x, y, z;
// how do I include *anything* that implements foo here?
... etc ...
}
[edit] I seem to have figured it out. Thanks for your help! I'll upload the result upon completion.