google-code-export / bullet

Automatically exported from code.google.com/p/bullet
0 stars 0 forks source link

Patch for btGjkEPA: better readable/more memory friendly for multi-core #28

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

A patch from Presson Nathanael for EPA:

For multi threading, the new version fit in less than 20kb (in double, ~10 
in float, can be tuned via EPA_MAX_VERTICES) of stack-frame and do not 
malloc so should be suitable for SPU's too.

Performances are about the the same as the old version on a single thread.

To resume:
- Its a complete rewrite, cleaner, more readable code.
- Stack frame only, low memory usage.

Sources:
- btGjkEpa2(h/cpp) : new implementation.
- patched v2.67beta1 of btGjkEpaPenetrationDepthSolver.cpp(35) to replace 
old version.
- patched v2.67beta1 of btGjkPairDetector.cpp(86) to switch from Bullet 
GJK to my GJK for testing.

Asides:
- Source should fit in 80 columns :)
- GJK-EPA operate in shape0 local space to reduce transforms calls.
- I will remove my typedefs and helpers if the new version become part of 
Bullet source distribution.
- Compile with 0 warnings at level 4 under vc2005, but didn't try on a 
Linux box.
- Accuracy,EPA_MAX_ITERATIONS or vertices>EPA_MAX_VERTICES stop epa 
iterations, and output the current result, so there is a trade off here 
(ex: thin ellipsoids PD may be inaccurate).

Original issue reported on code.google.com by erwin.coumans on 28 Feb 2008 at 10:29

Attachments:

GoogleCodeExporter commented 9 years ago

We included btGjkEpa2 in BulletCollision/NarrowphaseCollision. The old version 
is 
still default, we need some testing before deployment.

Original comment by erwin.coumans on 31 Mar 2008 at 4:38

GoogleCodeExporter commented 9 years ago

Original comment by erwin.coumans on 31 Mar 2008 at 4:39