Ocular Engine
|
#include <MeshResourceLoader.hpp>
Public Member Functions | |
MeshResourceLoader (std::string const &extension) | |
virtual bool | loadResource (Core::Resource *&resource, Core::File const &file, std::string const &mappingName) override |
Public Member Functions inherited from Ocular::Core::AResourceLoader | |
AResourceLoader (std::string const &extension, ResourceType type) | |
virtual std::string | getSupportedFileType () const |
virtual bool | loadSubResource (Resource *&resource, File const &file, std::string const &mappingName) |
virtual bool | exploreResource (File const &file) |
ResourceType | getResourceType () const |
Protected Member Functions | |
virtual bool | readFile (Core::File const &file, std::vector< Graphics::Vertex > &vertices, std::vector< uint32_t > &indices, uint32_t &numVertices, uint32_t &numIndices, Math::Vector3f &min, Math::Vector3f &max)=0 |
virtual bool | createResource (Core::Resource *&resource, Core::File const &file, std::vector< Graphics::Vertex > const &vertices, std::vector< uint32_t > const &indices, uint32_t numVertices, uint32_t numIndices, Math::Vector3f const &min, Math::Vector3f const &max) |
Protected Member Functions inherited from Ocular::Core::AResourceLoader | |
bool | isFileValid (Core::File const &file) const |
Additional Inherited Members | |
Protected Attributes inherited from Ocular::Core::AResourceLoader | |
std::string | m_SupportedExtension |
ResourceType | m_Type |
This is a common base implementation for all other ResourceLoaders that deal with creating and loading mesh resources. It provides a common base loadResource method as well as multiple utility helper methods.
By inheriting from MeshResourceLoader instead of AResourceLoader, the developer needs to only worry about their specific readFile implementation.
|
protectedvirtual |
Creates the new Mesh resource from provided data.
[out] | resource | The newly created resource. |
[in] | file | Source file for the resource. |
[in] | pixels | Pixel data for the texture arranged by rows. |
[in] | width | Width of the texture. |
[in] | height | Height of the texture. |
[in] | numVertices | Number of vertices in the mesh (depending on the loader implementation, this may not equal vertices.size()) |
[in] | numIndices | Number of indices in the mesh (depending on the loader implementation, this may not equal indices.size()) |
[in] | min | The minimum spatial point along the local axis among all vertices |
[in] | max | The maximum spatial point along the local axis among all vertices |
|
overridevirtual |
[out] | resource | |
[in] | file | |
[in] | mappingName |
Reimplemented from Ocular::Core::AResourceLoader.
|
protectedpure virtual |
Each MeshResourceLoader must provide a custom implementation for it's specific file type.
[in] | file | Source file to read from. |
[out] | vertices | Texture pixel data read in from the file. |
[out] | indices | Width of the texture. |
[out] | numVertices | Number of vertices in the mesh (depending on the loader implementation, this may not equal vertices.size()) |
[out] | numIndices | Number of indices in the mesh (depending on the loader implementation, this may not equal indices.size()) |
[out] | min | The minimum spatial point along the local axis among all vertices |
[out] | max | The maximum spatial point along the local axis among all vertices |
Implemented in Ocular::Graphics::MeshResourceLoader_PLY.