Monday, December 12, 2011

Collision Maps

Last post was mostly to showcase the assets I created. In this post I will go into more detail about collision maps. Prior to this project I have not worked with meshes in UDK (honestly I haven't done very much work with models and meshes of any kind), but in retrospect I should have anticipated collision problems. Automatically matching the collision map to every imported model isn't very feasible, especially for complex shapes.
I discovered that models imported into UDK seem to default to the smallest box that can fit the model. For my pallet and box this is obviously not an issue, but unfortunately this means the shelves will not be able to have objects placed on them unless I modify the collision map.



One tutorial and some tinkering later, and I managed to create a custom collision map in 3DS Max for my shelves. A collision map can be constructed out of several primitive polygons. More complex shapes could probably be used, but the idea is to use the simplest shapes possible to make collision detection calculations simpler. The fewer polygons you can use to create a collision map, the better.

Concave shapes are problematic for UDK, so extruding should be avoided. For example, with my shelve models I used 3-4 boxes and attached them. The only other thing to do is to center the collision map over the original model (in another layer) and give it the proper prefix and name. For example, my model was shelves_middle and my collision map was UCX_shelves_middle. There are apparently prefixes for specific kinds of collision maps such as boxes or spheres, but UCX is a catchall prefix that should work for most maps.




Now, when the model is imported, objects will be able to pass in between the shelves without colliding with invisible walls.

No comments:

Post a Comment