Implemented hull point projection; optional setting to project hull vertices back onto the original source mesh #40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request adds a new bool option (enabled by default) to V-HACD called 'm_projectHullVertices'.
If this is true, then the points on the convex hulls are projected back onto the original source mesh and, if there is an intersection and it is close enough, it 'snaps' the result to lie exactly on the surface of the original input data. Without this option some convex hulls produced, especially with lower voxel resolutions, introduce an excessive amount of error causing the collision volumes to not accurately describe the original source mesh (the object will appear as if it is slightly floating in the air in a physics simulation).
This process also eliminates nearly co-incident data points which can sometimes occur, introducing extremely tiny 'sliver' triangles into the resulting collision mesh. These tiny slivers cause both performance and sometimes behavior problems in some physics engines.
These concerns were raised by Epic regarding their integration of V-HACD into UE4. These fixes are in the process of being integrated into the latest version of UE4.
Here is a link to a YouTube video demonstrating the difference between running V-HACD without and then with the projection option enabled.
https://youtu.be/EYPeuGj-spg