Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented hull point projection; optional setting to project hull vertices back onto the original source mesh #40

Merged
merged 7 commits into from
Aug 13, 2017

Conversation

jratcliff63367
Copy link
Collaborator

@jratcliff63367 jratcliff63367 commented Aug 9, 2017

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

jratcliff added 7 commits July 25, 2017 11:48
… to a Wavefront OBJ file for debugging purposes. Added two sample meshes, including 'cube.obj' which demonstrates a problem reported by Epic.
… position output due to the voxelization step which produces approximate mesh positions instead of absolute. This fix does a lookup to make sure all hull vertices are exact relative to the original source mesh data.
@kmammou kmammou merged commit 7e756fc into kmammou:master Aug 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants