2009-01-14 04:37:51 -08:00
|
|
|
// Copyright (C) 2002-2009 Nikolaus Gebhardt
|
2007-05-20 11:03:49 -07:00
|
|
|
// This file is part of the "Irrlicht Engine".
|
|
|
|
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
|
|
|
|
2007-09-04 11:51:42 -07:00
|
|
|
#ifndef __C_MD2_MESH_FILE_LOADER_H_INCLUDED__
|
|
|
|
#define __C_MD2_MESH_FILE_LOADER_H_INCLUDED__
|
2007-05-20 11:03:49 -07:00
|
|
|
|
|
|
|
#include "IMeshLoader.h"
|
|
|
|
|
|
|
|
namespace irr
|
|
|
|
{
|
|
|
|
namespace scene
|
|
|
|
{
|
2009-08-24 02:12:27 -07:00
|
|
|
|
2008-12-30 03:13:22 -08:00
|
|
|
class CAnimatedMeshMD2;
|
2007-05-20 11:03:49 -07:00
|
|
|
|
2007-09-04 11:51:42 -07:00
|
|
|
//! Meshloader capable of loading MD2 files
|
|
|
|
class CMD2MeshFileLoader : public IMeshLoader
|
2007-05-20 11:03:49 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
//! Constructor
|
2007-09-04 11:51:42 -07:00
|
|
|
CMD2MeshFileLoader();
|
2007-05-20 11:03:49 -07:00
|
|
|
|
|
|
|
//! returns true if the file maybe is able to be loaded by this class
|
|
|
|
//! based on the file extension (e.g. ".bsp")
|
2009-08-24 02:12:27 -07:00
|
|
|
virtual bool isALoadableFileExtension(const io::path& filename) const;
|
2007-05-20 11:03:49 -07:00
|
|
|
|
|
|
|
//! creates/loads an animated mesh from the file.
|
|
|
|
//! \return Pointer to the created mesh. Returns 0 if loading failed.
|
|
|
|
//! If you no longer need the mesh, you should call IAnimatedMesh::drop().
|
2007-09-06 23:11:47 -07:00
|
|
|
//! See IReferenceCounted::drop() for more information.
|
2007-09-19 07:08:28 -07:00
|
|
|
virtual IAnimatedMesh* createMesh(io::IReadFile* file);
|
2007-05-20 11:03:49 -07:00
|
|
|
|
2008-12-30 03:13:22 -08:00
|
|
|
private:
|
|
|
|
//! Loads the file data into the mesh
|
|
|
|
bool loadFile(io::IReadFile* file, CAnimatedMeshMD2* mesh);
|
|
|
|
|
2007-05-20 11:03:49 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace scene
|
|
|
|
} // end namespace irr
|
|
|
|
|
2007-09-04 11:51:42 -07:00
|
|
|
#endif // __C_MD2_MESH_LOADER_H_INCLUDED__
|
2007-05-20 11:03:49 -07:00
|
|
|
|