gazebosim/gz-common

Make it possible to supply custom MeshLoader

开放

#404 创建于 2022年7月28日

 (5 条评论) (0 个反应) (0 位负责人)C++ (59 个派生)auto 404
enhancementgraphicshelp wanted

仓库指标

星标
 (28 个星标)
PR 合并指标
 (平均合并 9天 6小时) (30 天内合并 30 个 PR)

描述

Desired behavior

A developer using Gazebo could choose to supply a custom MeshLoader. The choice of MeshLoader could be determined by file extensions. More elaborate choice logic could be considered too.

Alternatives considered

N/A

Implementation suggestion

If we determine MeshLoader by file extensions, replace the current hard-coded logic in MeshManager with a choice logic backed by a hash map.

Additional context

Using the current snapshot of https://github.com/gazebosim/gz-common/tree/luca/assimp_sandbox as an example. The following was added to MeshManager

else if (extension == "gltf" || extension == "glb" || extension == "fbx")
      loader = &this->dataPtr->assimpLoader;

If one could choose to use Assimp for other file types (as determined by extensions), it's more flexible.

贡献者指南