danfis / libccd

Library for collision detection between two convex shapes
Other
478 stars 108 forks source link

Porting libccd to C++ and using Eigen for math #19

Open jslee02 opened 7 years ago

jslee02 commented 7 years ago

libccd is a nice collision detection library for convex shapes. Thanks to @danfis for this great work! I've been using libccd for many years through FCL for the collision detection of our multibody dynamics library DART.

Recently I'm interested in boosting the computational efficiency using SIMD, and would like to apply it to libccd as well. It would be done by replacing the built-in math codes of libccd with Eigen, which is a SIMD-enabled C++ linear algebra library. However, it is unable to switch the built-in math of libccd to Eigen as of now since libccd is written in C. That being said, to use Eigen, libccd needs to be ported to C++, then switch to Eigen. It wouldn't affect on this repository and would be placed in an another repository.

I wonder if @danfis or anyone would be interested in this work, but I'm willing to do it if @danfis don't mind. Please let me know how do you think.

Thanks in advance for any comment.

danfis commented 7 years ago

Hi, unfortunatelly, I don't have time for this in any foreseeable future. Sorry. But I think it should be enough to rewrite the implementation of functions in vec3.{h,c} and quat.{h,c} (and probably bor_vec3_t and bor_quat_t structures) using Eigen, then remove 'extern "C"' from headers and just compile the whole library using g++. I don't think you would need to do much more. I think somebody already wrote to me in past (maybe guys from bullet?) that it was easy to port the whole think to different math library, beacause all basic math operations are separated in vec3 and quat modules.

Good luck and let me know if you manage to port the whole thing. Cheers, Dan

jslee02 commented 7 years ago

Sorry for the delayed reply.

I found some code (e.g., btMprPenetration.h, b3MprPenetration.h) in bullet (probably what you refer to) where the math operation is replaced by bullet's own math code. It seems very similar to what I'd like to do except for I will use Eigen.

I created a new repo for this work. For now, it's just a copy of this repo, but will make changes as you suggested so you could see the progress. Thanks!

Best, JS

Edit: I'll post here once the porting is in good shape, but you could close this issue in the meantime.

balakumar-s commented 6 years ago

@jslee02 Did you finish the port? I am curious about the performance improvement.