I was thinking about an Dynamic AABB implementation the other day and saw that it was put on the annotated roadmap for Ogre 1.7.
It says:
First, is this under development?Skeletal animation bounding box updates
* One 'update' BB which covers the mesh at every animation point
* Dynamic AABB which updates based on bone extents, plus padding factor
If not, I thought (since I want this in my project) that I could start building one and if it turn out satisfactory, I would submit a patch.
I just have a question regarding the description above, and it's about the padding factor.
Is this padding intended to be per-bone or per-entity? (Or universal?)
If the answer is any of the two first I guess the data for this padding has to be stored somewhere in Ogre.
Depending on what accuracy is wanted the type of data and the place for it to be stored differs quite a bit.
For my dynamic AABB I've been thinking of a couple of ways to do it.
A) The system disregards any differences is the thickness of the body, i.e, one sets a per-entity padding factor and the AABB is calculated with respect to the bones's start and end points + padding factor.
On update the new positions for the bones are read and new maxs/mins for the AABB are set.
B) Padding factors are calculated per-bone according to the distance to the vertices that the bones influence. This is done at load time of the skeleton and mesh and the update will happen similar to A).
C) As B) but with two padding factors per bone, one at the end and one at the start. I guess parent end and child start would have to have the same padding factor or there could be some issues.
E) I have seen on several occasions BBs being calculated from capsules attached to the bones, kinda like a physical skeleton but just for updating the BB. I think this doesn't fit into the description "Padding factor" but I guess the result is somewhat like that of my C)-proposal. Also, it seems more like a physics engine than a render engine thing
Last, about the 'update' BB in the roadmap. If I understand this correctly, this is meant to set one single BB that fits every frame of every animation? So this would be calculated at load time?