Most efficient way to build collision meshes

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
ChrisN
Posts: 4
Joined: Fri Jun 13, 2008 7:48 am

Most efficient way to build collision meshes

Post by ChrisN »

Hi, just woundering about performance and the best way to build collision meshes on object (like boards on a arena), should I build with low triangle count (very large polygons) or should i have a uniform tessellation?

cheers
/ Chris
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Most efficient way to build collision meshes

Post by Norbo »

The best way to go about doing it is keeping everything on a similar relative scale. This means avoiding ultra-triangles extending for 600 units when your other objects are only a unit or two across. It's also good to avoid extremely stretched objects (1 unit across, 80 units long), which sometimes means leaning more towards uniform tessellation.

The cost of additional triangles is extremely low in terms of the time it takes to 'find' a triangle to collide against. If they become so small that one object can hit many triangles simultaneously, however, you will notice a performance drop due to the extra collision detection/response being done. Otherwise, the number of triangles is fairly inconsequential.
ChrisN
Posts: 4
Joined: Fri Jun 13, 2008 7:48 am

Re: Most efficient way to build collision meshes

Post by ChrisN »

Thanks for quick reply.
Post Reply