FHttpModule or CurlAssetAccessor in Unreal

Hello everyone, while learning Cesium for Unreal, I observed that the UnrealAssetAccessor uses FHttpModule for network access. However, CesiumNative itself provides CesiumCurl::CurlAssetAccessor. I’m wondering if it would be possible to completely detach from FHttpModule and use only CesiumCurl::CurlAssetAccessor to implement network resource access? Are there any plans to consider adding support for CesiumCurl::CurlAssetAccessor in the future? Currently, there seems to be a lack of code examples for this part - could anyone please provide an example?Thanks.

@Just9570 There’s not a way to configure this in Cesium for Unreal, and no plans to add a way, as Unreal itself just uses libcurl under the hood. It doesn’t seem to me like using curl directly would be very helpful. Is there some reason FHttpModule is insufficient for your use case?

Regardless, if you’d like to edit the source code of Cesium for Unreal to be able to use the CurlAssetAccessor instead of the UnrealAssetAccessor, you can change the std::make_shared<UnrealAssetAccessor>() line here to the std::make_shared<CurlAssetAccessor>(options) line you can find here.

Thank you for your response. Actually, I’m currently working on a Cesium business plugin based on Cesium Native, and I’m hoping to keep my plugin’s dependencies to a minimum - aside from Cesium Native itself, I want to rely as little as possible on other external implementations, such as the FHTTPModule mentioned here. This isn’t really a functional issue, but rather about reducing external dependencies.

I understand your suggestion about using std::make_shared<CurlAssetAccessor>(options), but what I’m unsure about is how to properly utilize it. Specifically, how should I work with these interfaces to completely replace all the functionality currently provided by FHTTPModule?

@Just9570 If all you’re looking to do is replace the UnrealAssetAccessor with cURL instead of FHttpModule, changing that one line will do the job. If you’re looking to use it directly, take a look at the documentation. The only part that should require further explanation is the AsyncSystem, which is what Cesium Native uses to dispatch jobs to other threads. If you’re using Unreal, you can call getAsyncSystem() to use the UnrealTaskProcessor to handle async tasks. If you’re trying to use Cesium Native outside of Unreal, you can read this part of the documentation to learn how to implement ITaskProcessor yourself.