I'm planning to design a character controller that provides semi-accurate hitboxes for an animated mesh.
My idea is to create an extremely low-poly version of the actual character model and split it into pieces:
Head
Upper_Body
Lower_Body
Left_Foot/Right_Foot
Lower_Left_Leg/Lower_Right_Leg
Upper_Left_Leg/Upper_Right_Leg
Left_Hand/Right_Hand
Left_Forearm/Right_Forearm
Left_Upperarm/Right_Upperarm
Each frame after the player model is animated I will extract out the positions and rotations from each bone and apply them to the appropriate piece listed above. These pieces would only be used for ray-casts to check if for example a bullet hit a particular spot on the body.
Aside from these pieces I could use two capsule shapes for actually moving the character through the environment. One tall capsule to represent the standing character and one short capsule to represent the crouched player. Collisions would only ever be enabled on one capsule depending on the crouched state of the character.
To me this setup seems like it would provide the best performance since the "pieces" would only ever be used for ray-casts and the capsules are used for physical movement through the world.
The only thing that slightly bothers me with this is that if for example a box is thrown at a player then the collision would happen with the capsules and thus it wouldn't quite look right (especially if the character was bent down in a 'touching their toes' position).
This leads me to want to drop the capsules all together and use the pieces for movement as well however I feel that manually setting the positions and rotations on these objects during animation would be problematic for movement.
I'm not even sure I can safely set the physical positions and rotations of a physics body, I have a feeling I must manipulate them using forces/impulses?
Am I on the right track here or is there a better way to do this?