flexible-collision-library / fcl

Flexible Collision Library
https://flexible-collision-library.github.io/
Other
1.41k stars 417 forks source link

Best setting for simple collision checking #425

Closed AdmiralPellaeon closed 4 years ago

AdmiralPellaeon commented 4 years ago

Hi,

I test the funcionality of FCL to see if I can use it to replace the old opcode library. In my use case I want to check meshes for collisions. No dynamic situation, all is static. I only move and rotate my meshes with Transform. In my first tests, FCL is much slower compared to opcode. Therefore, I want to ask which setting is recommend for my use case to get the best performance. Atm I use fcl::OBB as bounding object and fcl::BVHModel as collision model

Mx7f commented 4 years ago

Probably too late to be useful, but I've been testing this out for a project, and here are timings for a dynamic scene with ~300 objects, ~100k triangles, discrete collision detection, though the objects vertices are deformable.

AABB Refit: 13.25ms KDOP16 Refit: 20.56ms KDOP18 Refit: 21.82ms KDOP24 Refit: 27.13ms AABB Rebuild: 57.32ms OBB Refit: 84.00ms kIOS Refit: 106.13ms KDOP16 Rebuild: 111.56ms KDOP18 Rebuild: 119.59ms KDOP24 Rebuild: 150.14ms OBB Rebuild: 255.53ms OBBRSS Refit: 261.76ms kIOS Rebuild: 305.59ms RSS Rebuild: 316.47ms OBBRSS Rebuild: 361.16ms RSS Refit: 463.17ms

So if you were rebuilding from scratch every collision detection, you might be able to get a factor of 5 speedup by switching to AABB, but this will depend heavily on how "cubic" your objects are. If you were rebuilding but could get away with refitting, you might have ~20x on the table.

sherm1 commented 4 years ago

Thanks, @Mx7f !

SeanCurtis-TRI commented 4 years ago

Closing this issue as it isn't particularly actionable. If more data comes in that is relevant to this conversation, feel free to re-open.