2007-05-20 11:03:49 -07:00
|
|
|
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
|
|
|
// 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_MS3D_MESH_FILE_LOADER_H_INCLUDED__
|
|
|
|
#define __C_MS3D_MESH_FILE_LOADER_H_INCLUDED__
|
2007-05-20 11:03:49 -07:00
|
|
|
|
|
|
|
#include "IMeshLoader.h"
|
|
|
|
#include "IVideoDriver.h"
|
2007-09-04 11:51:42 -07:00
|
|
|
#include "CSkinnedMesh.h"
|
2007-05-20 11:03:49 -07:00
|
|
|
|
|
|
|
namespace irr
|
|
|
|
{
|
|
|
|
namespace scene
|
|
|
|
{
|
|
|
|
|
2007-09-04 11:51:42 -07:00
|
|
|
//! Meshloader capable of loading Milkshape 3D files
|
|
|
|
class CMS3DMeshFileLoader : public IMeshLoader
|
2007-05-20 11:03:49 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
//! Constructor
|
2007-09-04 11:51:42 -07:00
|
|
|
CMS3DMeshFileLoader(video::IVideoDriver* driver);
|
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")
|
2007-09-16 16:41:55 -07:00
|
|
|
virtual bool isALoadableFileExtension(const c8* 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
|
|
|
|
|
|
|
private:
|
|
|
|
|
2007-12-03 02:07:40 -08:00
|
|
|
core::stringc stripPathFromString(const core::stringc& inString, bool returnPath) const;
|
2007-09-04 11:51:42 -07:00
|
|
|
|
2007-09-19 07:08:28 -07:00
|
|
|
bool load(io::IReadFile* file);
|
2007-05-20 11:03:49 -07:00
|
|
|
video::IVideoDriver* Driver;
|
2007-09-04 11:51:42 -07:00
|
|
|
CSkinnedMesh* AnimatedMesh;
|
|
|
|
|
|
|
|
struct SGroup
|
|
|
|
{
|
|
|
|
core::stringc Name;
|
|
|
|
core::array<u16> VertexIds;
|
|
|
|
u16 MaterialIdx;
|
|
|
|
};
|
|
|
|
|
|
|
|
core::array<SGroup> Groups;
|
|
|
|
|
2007-05-20 11:03:49 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace scene
|
|
|
|
} // end namespace irr
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2007-09-04 11:51:42 -07:00
|
|
|
|