Getting the absolute transform for a Model without any Bones.

Topics: User Forum
Apr 19, 2007 at 4:13 PM
I have a question related to the per-bone collision detection tutorial.

In it you get the absolute transform for the current fram by calling ModelAnimator.GetAbsoluteTransform for the relevant Bone.
My question is if there are any ways to get the absolute transform for a Model without any Bones. In our game we have both Models with Bones (Humans) and Models without (cars), and I would like to create Bounding Boxes for both.

I know I could create Bounding Spheres for each mesh, but I don't need that kind of granularity, so I'd rather just have one Box that I'd transform along with the Models movement.
So I either need to know the absolute transform, or the models (or a mesh's) current position.

Thanks!

Donny
Coordinator
Apr 19, 2007 at 9:36 PM
In xna, all models have a skeletal structure. So, even if you don't rig a model, each will still have a parent bone. You can access that by Mesh.ParentBone, and you can get it's index through Mesh.ParentBone.Index.