aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/irrlicht-1.8.1/source/Irrlicht/CLWOMeshFileLoader.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/others/irrlicht-1.8.1/source/Irrlicht/CLWOMeshFileLoader.h')
-rw-r--r--src/others/irrlicht-1.8.1/source/Irrlicht/CLWOMeshFileLoader.h87
1 files changed, 87 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/source/Irrlicht/CLWOMeshFileLoader.h b/src/others/irrlicht-1.8.1/source/Irrlicht/CLWOMeshFileLoader.h
new file mode 100644
index 0000000..c72d666
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/source/Irrlicht/CLWOMeshFileLoader.h
@@ -0,0 +1,87 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#ifndef __C_LWO_MESH_FILE_LOADER_H_INCLUDED__
6#define __C_LWO_MESH_FILE_LOADER_H_INCLUDED__
7
8#include "IMeshLoader.h"
9#include "SMeshBuffer.h"
10#include "irrString.h"
11
12namespace irr
13{
14namespace io
15{
16 class IReadFile;
17 class IFileSystem;
18} // end namespace io
19namespace scene
20{
21
22 struct SMesh;
23 class ISceneManager;
24
25//! Meshloader capable of loading Lightwave 3D meshes.
26class CLWOMeshFileLoader : public IMeshLoader
27{
28public:
29
30 //! Constructor
31 CLWOMeshFileLoader(scene::ISceneManager* smgr, io::IFileSystem* fs);
32
33 //! destructor
34 virtual ~CLWOMeshFileLoader();
35
36 //! returns true if the file maybe is able to be loaded by this class
37 //! based on the file extension (e.g. ".bsp")
38 virtual bool isALoadableFileExtension(const io::path& filename) const;
39
40 //! creates/loads an animated mesh from the file.
41 //! \return Pointer to the created mesh. Returns 0 if loading failed.
42 //! If you no longer need the mesh, you should call IAnimatedMesh::drop().
43 //! See IUnknown::drop() for more information.
44 virtual IAnimatedMesh* createMesh(io::IReadFile* file);
45
46private:
47
48 struct tLWOMaterial;
49
50 bool readFileHeader();
51 bool readChunks();
52 void readObj1(u32 size);
53 void readTagMapping(u32 size);
54 void readVertexMapping(u32 size);
55 void readDiscVertexMapping (u32 size);
56 void readObj2(u32 size);
57 void readMat(u32 size);
58 u32 readString(core::stringc& name, u32 size=0);
59 u32 readVec(core::vector3df& vec);
60 u32 readVX(u32& num);
61 u32 readColor(video::SColor& color);
62 video::ITexture* loadTexture(const core::stringc& file);
63
64 scene::ISceneManager* SceneManager;
65 io::IFileSystem* FileSystem;
66 io::IReadFile* File;
67 SMesh* Mesh;
68
69 core::array<core::vector3df> Points;
70 core::array<core::array<u32> > Indices;
71 core::array<core::stringc> UvName;
72 core::array<core::array<u32> > UvIndex;
73 core::array<core::stringc> DUvName;
74 core::array<core::array<u32> > VmPolyPointsIndex;
75 core::array<core::array<core::vector2df> > VmCoordsIndex;
76
77 core::array<u16> MaterialMapping;
78 core::array<core::array<core::vector2df> > TCoords;
79 core::array<tLWOMaterial*> Materials;
80 core::array<core::stringc> Images;
81 u8 FormatVersion;
82};
83
84} // end namespace scene
85} // end namespace irr
86
87#endif