Skip to content
Pre-release

@Ybalrid Ybalrid released this Jul 22, 2018 · 65 commits to master since this release

Thanks to @darksylinc suggestion:
This release adds the two following methods to the glTTLoaderInterface Plugin :

	///struct that contains a mesh and the datablock that should be used with it.
	///This represent what an extracted object from a glTF asset contains.
	///The mash should have a skeletonInstance attached to it the glTF file defined a skin;
	struct MeshAndDataBlock
	{
		///Pointer to the Ogre Mesh
		Ogre::MeshPtr Mesh;

		///Pointer to the HlmsDatablock. This should be a HlmsPbsDatablock
		Ogre::HlmsDatablock* datablock;
	};

	///Plugin accessible interface that plugin users can use
	struct glTFLoaderInterface
	{
		/* ... */

		//NEW BELOW:

		///Get you a mesh and a material datablock from a GLB in the resource manager
		/// \param name The name of the resource
		/// \return a struct containing pointers to a mesh and a datablock
		virtual MeshAndDataBlock getMeshFromResource(const std::string& name) = 0;

		///Get you  mesh and a material datablock from GLB or a GLTF file from the filesystem
		/// \param name The name of the resource
		/// \return a struct containing pointers to a mesh and a datablock
		virtual MeshAndDataBlock getMeshFromFileSystem(const std::string& name) = 0;
	};

Theses addition to the interface permit you to get the v2 Mesh (with it's skeleton instance and animation), and the data block used as a material on it separately.

This way you can plug this to a more complex caching system for gltf assets, and not limit you to consuming them.

(see the "note" on this forum post: https://forums.ogre3d.org/viewtopic.php?f=25&t=94387#p542155)

Assets 2
You can’t perform that action at this time.