I have written a skeletal animation system for a game i am working on. To draw lines that represent a skeleton, i use the GL matrix, and multiply it by each bone a long the body. For example before drawing the left hand, GL.multMatrix has been called for the lower back, upper back, left shoulder, left upper arm and left lower arm.
Currently i am now trying to deal with hitboxes. After this series of matrix transformations have been made, i am drawing a box with the local coordinates of -2,-2,-2 to 2,2,2. This works fine, the animated skeleton has a box around the hand.
However i've reached the stage of actually needing to use the hitbox, to check if it collides with another hitbox. I've worked out the algorithms i shall use for checking if there is a collision, but i first need to change those coordinates from their local to the hand coordinates, into coordinates i can use against other things in the world.
For example the left hand hitbox has the same local coordinates as the right hand hitbox, but how could i change that all back to global coordinates so i can get their proper world coordinates?
Thanks for any help!