Currently the resource manager is hard-coded to look for meshes as COLLADA files. This is less than idea for various reasons:
COLLADA is an interchange format for transferring data between program and is slow to parse and load. Ideally we'd want to pre-process the COLLADA files into a compact binary representation that will be faster to load at runtime.
We want to support other mesh file formats than COLLADA, so the resource manager shouldn't be tied to a single source format. Rather it should have various providers that can translate the source formats into a single shared format.
The engine itself can't use COLLADA directly because it doesn't format data in a way that can be used by the graphics card. lib-polygon defines the Mesh type which is the only type of mesh the engine should actually support, all other mesh formats should be processed offline and turned into binary Mesh data which the resource manager can handle directly.
In the long term I'd like to completely move the COLLADA processing code out of gunship-core, but for now it's enough to build up a layer of abstraction between the resource manager and the COLLADA processing layer. Conceptually I'd like to break it down such that when the game layer specifies that a file to load the resource manager checks the extension and if it's ".dae" it sends the file over to the COLLADA processor. The processing layer should then spit out a set of Mesh objects with the associated URI that can be used to identify the mesh and associate it with entities in the scene.
Ideally when this is done the COLLADA-related code should be completely compartmentalized and the resource manager should know nothing about COLLADA beyond its file extension so that it can pass the appropriate files to the processing layer. This will make it so that later on this layer can be pulled out into a separate library that can be used to pre-process the COLLADA files and spit out mesh files that the resource manager can use directly, though that is outside the scope of this issue.
Currently the resource manager is hard-coded to look for meshes as COLLADA files. This is less than idea for various reasons:
Mesh
type which is the only type of mesh the engine should actually support, all other mesh formats should be processed offline and turned into binaryMesh
data which the resource manager can handle directly.In the long term I'd like to completely move the COLLADA processing code out of gunship-core, but for now it's enough to build up a layer of abstraction between the resource manager and the COLLADA processing layer. Conceptually I'd like to break it down such that when the game layer specifies that a file to load the resource manager checks the extension and if it's ".dae" it sends the file over to the COLLADA processor. The processing layer should then spit out a set of
Mesh
objects with the associated URI that can be used to identify the mesh and associate it with entities in the scene.Ideally when this is done the COLLADA-related code should be completely compartmentalized and the resource manager should know nothing about COLLADA beyond its file extension so that it can pass the appropriate files to the processing layer. This will make it so that later on this layer can be pulled out into a separate library that can be used to pre-process the COLLADA files and spit out mesh files that the resource manager can use directly, though that is outside the scope of this issue.