5#ifndef HEADER_STK_MESH_LOADER_HPP
6#define HEADER_STK_MESH_LOADER_HPP
8#include "../lib/irrlicht/source/Irrlicht/CSkinnedMesh.h"
10#include <IMeshLoader.h>
11#include <ISceneManager.h>
14#include <unordered_map>
27 static int m_straight_frame;
40 virtual scene::IAnimatedMesh*
createMesh(io::IReadFile* file);
53 return a.weight > b.weight;
56 typedef core::array<core::array <core::array<JointInfluence> > >
61 std::unordered_map<scene::IMeshBuffer*, std::pair<std::string, std::string> > m_texture_string;
72 : length(header.size+8), startposition(sp)
74 name[0]=header.name[0];
75 name[1]=header.name[1];
76 name[2]=header.name[2];
77 name[3]=header.name[3];
87 core::stringc TextureName;
100 blue(1.0f), alpha(1.0f), shininess(0.0f), blend(1),
103 for (u32 i=0; i<video::MATERIAL_MAX_TEXTURES; ++i)
107 f32 red, green, blue, alpha;
110 SB3dTexture *Textures[video::MATERIAL_MAX_TEXTURES];
113 void computeWeightInfluence(scene::CSkinnedMesh::SJoint* joint,
114 unsigned& index, WeightInfluence& wi);
116 void addSPAnimation(
SP::SPMesh* spm, scene::CSkinnedMesh::SJoint* joint,
117 unsigned& index,
unsigned frame);
120 bool readChunkNODE(scene::CSkinnedMesh::SJoint* InJoint);
121 bool readChunkMESH(scene::CSkinnedMesh::SJoint* InJoint);
122 bool readChunkVRTS(scene::CSkinnedMesh::SJoint* InJoint);
123 bool readChunkTRIS(scene::SSkinMeshBuffer *MeshBuffer, u32 MeshBufferID, s32 Vertices_Start);
124 bool readChunkBONE(scene::CSkinnedMesh::SJoint* InJoint);
125 bool readChunkKEYS(scene::CSkinnedMesh::SJoint* InJoint);
126 bool readChunkANIM();
127 bool readChunkTEXS();
128 bool readChunkBRUS();
130 void loadTextures(
SB3dMaterial& material, scene::IMeshBuffer* mb);
132 void readString(core::stringc& newstring);
133 void readFloats(f32* vec, u32 count);
135 core::array<SB3dChunk> B3dStack;
137 core::array<SB3dMaterial> Materials;
138 core::array<SB3dTexture> Textures;
140 core::array<s32> AnimatedVertices_VertexID;
142 core::array<s32> AnimatedVertices_BufferID;
144 core::array<video::S3DVertex2TCoords> BaseVertices;
146 scene::ISceneManager* SceneManager;
147 scene::CSkinnedMesh* AnimatedMesh;
148 io::IReadFile* B3DFile;
155 bool HasVertexColors;
Definition: b3d_mesh_loader.hpp:44
Definition: b3d_mesh_loader.hpp:25
virtual scene::IAnimatedMesh * createMesh(io::IReadFile *file)
creates/loads an animated mesh from the file.
Definition: b3d_mesh_loader.cpp:55
virtual bool isALoadableFileExtension(const io::path &filename) const
returns true if the file maybe is able to be loaded by this class based on the file extension (e....
Definition: b3d_mesh_loader.cpp:45
Definition: material.hpp:48
Definition: sp_mesh.hpp:44
Definition: b3d_mesh_loader.hpp:70
Definition: b3d_mesh_loader.hpp:98
Definition: b3d_mesh_loader.hpp:86