Model & scale

Jul 5, 2010 at 2:39 PM


I would like to check the collesion between a sphere and some Model that I load in my game.

I see there is a ModelCollisionMeshProxy that should fit my needing, but what about if the model is *scaled* and tranlorotated ? How can I specify the trasform of my model so the engine can calculate the collisions ?


Thanks a lot,


Jul 7, 2010 at 6:56 AM

Right now, to give a model a different scale for collisions, you'll have to set the Scale property on the ModelProcessor of your model asset in the content project.  You can then set the Position and Orientation field (via UpdateTransform method) on the CollisionGroup that owns the CollisionMesh to place the model.  Make sure to draw the model the CollisionMesh represents with the same Scale, Orientation and Translation as the CollisionMesh.


Good luck!

Jul 7, 2010 at 8:27 AM

Thank you,

I see how to solve. Problem is my poor knowledge of XNA framework, so I need to find how to scale the model *before* it join the scene.