I have lately worked on re-factoring the V-HACD code to make it easier to integrate. An example of code using V-HACD would look like this.
All the magic happens at line 14 where the IVHACD::Compute() function is called. In order to cancel the decomposition process, the function IVHACD::Cancel() could be called from any other thread.
V-HACD offers the user the possibility to track progress and get access to logging information. The only thing the user needs to do is to provide his implementation of the two abstract classes IUserCallback and IUserLogger.
Below, an example of implementation of IUserCallback.
The Update() callback is called regularly during the decomposition process to report:
- The overall progress,
- The progress of the current stage, and
- The progress of the current operation.
An example of implementation of IUserLogger may look as follows.
MyCallback and MyLogger are hooked to the IVHACD object by updating encode parameters as follows.