2007-09-07 23:10:52 -07:00
|
|
|
#ifndef __IRR_C_COLLADA_MESH_WRITER_H_INCLUDED__
|
|
|
|
#define __IRR_C_COLLADA_MESH_WRITER_H_INCLUDED__
|
|
|
|
|
|
|
|
#include "IMeshWriter.h"
|
|
|
|
#include "S3DVertex.h"
|
|
|
|
#include "IVideoDriver.h"
|
|
|
|
|
|
|
|
namespace irr
|
|
|
|
{
|
|
|
|
namespace io
|
|
|
|
{
|
|
|
|
class IXMLWriter;
|
2007-09-08 03:51:27 -07:00
|
|
|
class IFileSystem;
|
2007-09-07 23:10:52 -07:00
|
|
|
}
|
|
|
|
namespace scene
|
|
|
|
{
|
|
|
|
|
|
|
|
//! class to write meshes, implementing a COLLADA (.dae, .xml) writer
|
|
|
|
/** This writer implementation has been originally developed for irrEdit and then
|
|
|
|
merged out to the Irrlicht Engine */
|
|
|
|
class CColladaMeshWriter : public IMeshWriter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2007-09-19 07:08:28 -07:00
|
|
|
CColladaMeshWriter(video::IVideoDriver* driver, io::IFileSystem* fs);
|
2007-09-07 23:10:52 -07:00
|
|
|
virtual ~CColladaMeshWriter();
|
|
|
|
|
|
|
|
//! Returns the type of the mesh writer
|
|
|
|
virtual EMESH_WRITER_TYPE getType() const;
|
|
|
|
|
2007-09-08 03:51:27 -07:00
|
|
|
//! writes a mesh
|
2007-09-07 23:10:52 -07:00
|
|
|
virtual bool writeMesh(io::IWriteFile* file, scene::IMesh* mesh, s32 flags=EMWF_NONE);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2007-09-10 02:27:37 -07:00
|
|
|
bool hasSecondTextureCoordinates(video::E_VERTEX_TYPE type) const;
|
2007-09-07 23:10:52 -07:00
|
|
|
|
|
|
|
struct SComponentGlobalStartPos
|
|
|
|
{
|
2007-09-08 03:51:27 -07:00
|
|
|
SComponentGlobalStartPos() : PosStartIndex(-1), PosLastIndex(-1),
|
|
|
|
NormalStartIndex(-1), NormalLastIndex(-1),
|
|
|
|
TCoord0StartIndex(-1), TCoord0LastIndex(-1),
|
|
|
|
TCoord1StartIndex(-1), TCoord1LastIndex(-1)
|
|
|
|
{ }
|
2007-09-07 23:10:52 -07:00
|
|
|
|
|
|
|
s32 PosStartIndex;
|
|
|
|
s32 PosLastIndex;
|
|
|
|
|
|
|
|
s32 NormalStartIndex;
|
|
|
|
s32 NormalLastIndex;
|
|
|
|
|
2007-09-08 03:51:27 -07:00
|
|
|
s32 TCoord0StartIndex;
|
|
|
|
s32 TCoord0LastIndex;
|
|
|
|
|
2007-09-07 23:10:52 -07:00
|
|
|
s32 TCoord1StartIndex;
|
|
|
|
s32 TCoord1LastIndex;
|
|
|
|
};
|
|
|
|
|
|
|
|
io::IFileSystem* FileSystem;
|
|
|
|
video::IVideoDriver* VideoDriver;
|
|
|
|
io::IXMLWriter* Writer;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // end namespace
|
2007-09-08 03:51:27 -07:00
|
|
|
} // end namespace
|
|
|
|
|
|
|
|
#endif
|
2007-09-07 23:10:52 -07:00
|
|
|
|