Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor glTFLoaderInterface #16

Closed
Ybalrid opened this issue Oct 28, 2018 · 0 comments · Fixed by #20
Assignees
Labels
Milestone

Comments

@Ybalrid
Copy link
Owner

@Ybalrid Ybalrid commented Oct 28, 2018

Currently the interface looks like this :

    ///Plugin accessible interface that plugin users can use
    struct glTFLoaderInterface
    {
        ///Polymorphic dtor
        virtual ~glTFLoaderInterface() = default;

        ///Get you an item from a GLB file loaded inside an Ogre resource group
        virtual Ogre::Item* getItemFromResource(const std::string& name, Ogre::SceneManager* smgr) = 0;

        ///Get you an item and transform from a GLB file loaded inside an Ogre resource group
        virtual ItemAndTransform getItemAndTransformFromResource(const std::string& name, Ogre::SceneManager* smgr) = 0;

        ///Get you an item and transform from a GLB or a GLTF file from the filesystem.
        virtual ItemAndTransform getItemAndTransformFromFileSystem(const std::string& name, Ogre::SceneManager* smgr) =0;

        ///Get you an item from a GLB or a GLTF file from the filesystem.
        virtual Ogre::Item* getItemFromFileSystem(const std::string& fileName, Ogre::SceneManager* smgr) = 0;

        ///Get you a mesh and a material datablock from a GLB in the resource manager
        virtual MeshAndDataBlock getMeshFromResource(const std::string& name) = 0;

        ///Gets you a mesh and a material datablock from GLB or a GLTF file from the filesystem
        virtual MeshAndDataBlock getMeshFromFileSystem(const std::string& name) = 0;
    };

The XXXFileSystem and XXXResource methods are mostly identical. A simple flag could singal where we are supposed to load from.

Returning an Item, or a Mesh, or an Item with a transofrom (or a mesh with a transform,t hat is not possible right now) should be handled better.

@Ybalrid Ybalrid self-assigned this Oct 28, 2018
@Ybalrid Ybalrid added the enhancement label Oct 28, 2018
@Ybalrid Ybalrid added this to the Version 0.2 milestone Oct 28, 2018
@Ybalrid Ybalrid closed this in #20 Oct 31, 2018
Ybalrid added a commit that referenced this issue Oct 31, 2018
Plugin interface refactor  (fix #16)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.