gazebosim/gz-common

Make it possible to supply custom MeshLoader

Ouverte

#404 ouverte le 28 juil. 2022

 (5 commentaires) (0 réaction) (0 personne assignée)C++ (59 forks)auto 404
enhancementgraphicshelp wanted

Métriques du dépôt

Stars
 (28 étoiles)
Métriques de merge PR
 (Merge moyen 9j 6h) (30 PRs mergées en 30 j)

Description

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.

Guide contributeur