Use the Draco and make it as a third-party library in UE4.
First of all, download the archive .
Then, you just extra the archive in [your_project_root]/ThirdParty/ for a UE4 project, or extra the archive in [your_plugin_root]/Source/ThirdParty/ for a UE4 plugin.
Just add the libdraco_ue4
to the PublicDependencyModuleNames
list in [your_module.Build.cs].
When include the draco's header file, you need write like this:
Because it has a compiler conflict between the
draco::Status::Code::ERROR
and the macroERROR
in UE4 when compile.For example
#include "draco/compression/decode.h"
.
#if defined(ERROR)
#define DRACO_MACRO_TEMP_ERROR ERROR
#undef ERROR
#endif
#include "draco/compression/decode.h"
#if defined(DRACO_MACRO_TEMP_ERROR)
#define ERROR DRACO_MACRO_TEMP_ERROR
#undef DRACO_MACRO_TEMP_ERROR
#endif