Monday 2 January 2012

Extending the content pipeline

So XNA provides a very nice content pipeline.

Basically the way it takes content or media and makes it available in the programming environment and game.

So the model processor is the content processor that lets you work with the 3D objects. It's what creates the bounding spheres and provides all the other methods.

So you can extend any of these processors and use your own custom one on any content imported.

You don't have to do this at all. I could work out bounding box coordinates from my model mesh at run time, but it would need to be constantly updated and therefore processor intensive.

Extending the content processor means I can pre process the models and provide the data I need at point of initialization so the processor only has to do this once at game load (or at least model load)

So with a custom model processor that generates my bounding box data for me, means an more efficient solution.

Now all I need to do is set the content processor of the model fbx files (in the property explorer in visual studio) to the new custom model processor.

Now I have a bounding box for my 3D objects.

No comments:

Post a Comment