I have written a skeletal animation system for a game iI am working on. To draw lines that represent a skeleton, iI 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 iI am now trying to deal with hitboxes. After this series of matrix transformations have been made, iI 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'veI'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 iI shall use for checking if there is a collision, but iI first need to change those coordinates from their local to the hand coordinates, into coordinates iI 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 iI change that all back to global coordinates so iI can get their proper world coordinates?
Thanks for any help!