   [DX9] D3DXMESH subset recognition
  Hey guys !I woke up this morning and felt I should take the time to implement collision detection into my game engine. The way I would like to do this is model primitive box subsets into the game assets and always name these "Collision" or something. Then what I would like to do within the game engine is check through the subsets of a loaded D3DXMESH if it has a subset by that name, and if so retrieve it's attribute ID to use with D3DXIntersectSubset.I realize I could just always just check if they game assets have a 2nd subset but I wanted to hear if anyone might help me find a way to find a more generic solution. Many thanks in advance ![Edit] Ok, I guess since at least Pandasoft's 3ds Max exporter doesn't bother to store the mesh names there might not be any method of retrieving a subset's textual name. So I would have to rely on some other way of distinguishing a collision subset from the rendered one.It seems to me that there is no way to be sure in which order subsets are exported and loaded either so I couldn't just assume that subset 0 is the rendered one. I guess I could assume that the collision subset always is the only one with 12 faces (a box) as it seems very unlikely that I would create an asset that simple, but still I would like to go with a more reliable solution if anyone has one to suggest.[Edit2] I know for a fact that when exporting a mesh with skeletal animation, unchecking "Renderable" on the skeleton in 3ds Max prevents it from being rendered in Direct3D9. This is a property that I really have no idea how it is recognized by D3D but it does seem like a neat way of distinguishing helper subsets in a static mesh. Sorry if this post is starting to seem cluttered but I can see how this might be useful to others in the future.[Edit3] Guess I'll just always make the material of collision subsets pitch black or something and check for that within the program.[Edited by - Vanderry on May 8, 2010 2:13:53 AM]