MDCLoader.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. /*
  2. ---------------------------------------------------------------------------
  3. Open Asset Import Library (assimp)
  4. ---------------------------------------------------------------------------
  5. Copyright (c) 2006-2024, assimp team
  6. All rights reserved.
  7. Redistribution and use of this software in source and binary forms,
  8. with or without modification, are permitted provided that the following
  9. conditions are met:
  10. * Redistributions of source code must retain the above
  11. copyright notice, this list of conditions and the
  12. following disclaimer.
  13. * Redistributions in binary form must reproduce the above
  14. copyright notice, this list of conditions and the
  15. following disclaimer in the documentation and/or other
  16. materials provided with the distribution.
  17. * Neither the name of the assimp team, nor the names of its
  18. contributors may be used to endorse or promote products
  19. derived from this software without specific prior
  20. written permission of the assimp team.
  21. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  25. OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  26. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  27. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  28. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  29. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  31. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. ---------------------------------------------------------------------------
  33. */
  34. /** @file Implementation of the MDC importer class */
  35. #ifndef ASSIMP_BUILD_NO_MDC_IMPORTER
  36. // internal headers
  37. #include "AssetLib/MDC/MDCLoader.h"
  38. #include "AssetLib/MD3/MD3FileData.h"
  39. #include "AssetLib/MDC/MDCNormalTable.h" // shouldn't be included by other units
  40. #include <assimp/importerdesc.h>
  41. #include <assimp/scene.h>
  42. #include <assimp/DefaultLogger.hpp>
  43. #include <assimp/IOSystem.hpp>
  44. #include <assimp/Importer.hpp>
  45. #include <assimp/StringUtils.h>
  46. #include <memory>
  47. using namespace Assimp;
  48. using namespace Assimp::MDC;
  49. static constexpr aiImporterDesc desc = {
  50. "Return To Castle Wolfenstein Mesh Importer",
  51. "",
  52. "",
  53. "",
  54. aiImporterFlags_SupportBinaryFlavour,
  55. 0,
  56. 0,
  57. 0,
  58. 0,
  59. "mdc"
  60. };
  61. // ------------------------------------------------------------------------------------------------
  62. void MDC::BuildVertex(const Frame &frame,
  63. const BaseVertex &bvert,
  64. const CompressedVertex &cvert,
  65. aiVector3D &vXYZOut,
  66. aiVector3D &vNorOut) {
  67. // compute the position
  68. const float xd = (cvert.xd - AI_MDC_CVERT_BIAS) * AI_MDC_DELTA_SCALING;
  69. const float yd = (cvert.yd - AI_MDC_CVERT_BIAS) * AI_MDC_DELTA_SCALING;
  70. const float zd = (cvert.zd - AI_MDC_CVERT_BIAS) * AI_MDC_DELTA_SCALING;
  71. vXYZOut.x = frame.localOrigin.x + AI_MDC_BASE_SCALING * (bvert.x + xd);
  72. vXYZOut.y = frame.localOrigin.y + AI_MDC_BASE_SCALING * (bvert.y + yd);
  73. vXYZOut.z = frame.localOrigin.z + AI_MDC_BASE_SCALING * (bvert.z + zd);
  74. // compute the normal vector .. ehm ... lookup it in the table :-)
  75. vNorOut.x = mdcNormals[cvert.nd][0];
  76. vNorOut.y = mdcNormals[cvert.nd][1];
  77. vNorOut.z = mdcNormals[cvert.nd][2];
  78. }
  79. // ------------------------------------------------------------------------------------------------
  80. // Constructor to be privately used by Importer
  81. MDCImporter::MDCImporter() :
  82. configFrameID(),
  83. pcHeader(),
  84. mBuffer(),
  85. fileSize() {
  86. // empty
  87. }
  88. // ------------------------------------------------------------------------------------------------
  89. // Returns whether the class can handle the format of the given file.
  90. bool MDCImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool /*checkSig*/) const {
  91. static const uint32_t tokens[] = { AI_MDC_MAGIC_NUMBER_LE };
  92. return CheckMagicToken(pIOHandler, pFile, tokens, AI_COUNT_OF(tokens));
  93. }
  94. // ------------------------------------------------------------------------------------------------
  95. const aiImporterDesc *MDCImporter::GetInfo() const {
  96. return &desc;
  97. }
  98. // ------------------------------------------------------------------------------------------------
  99. // Validate the header of the given MDC file
  100. void MDCImporter::ValidateHeader() {
  101. AI_SWAP4(this->pcHeader->ulVersion);
  102. AI_SWAP4(this->pcHeader->ulFlags);
  103. AI_SWAP4(this->pcHeader->ulNumFrames);
  104. AI_SWAP4(this->pcHeader->ulNumTags);
  105. AI_SWAP4(this->pcHeader->ulNumSurfaces);
  106. AI_SWAP4(this->pcHeader->ulNumSkins);
  107. AI_SWAP4(this->pcHeader->ulOffsetBorderFrames);
  108. if (pcHeader->ulIdent != AI_MDC_MAGIC_NUMBER_BE &&
  109. pcHeader->ulIdent != AI_MDC_MAGIC_NUMBER_LE) {
  110. throw DeadlyImportError("Invalid MDC magic word: expected IDPC, found ",
  111. ai_str_toprintable((char *)&pcHeader->ulIdent, 4));
  112. }
  113. if (pcHeader->ulVersion != AI_MDC_VERSION) {
  114. ASSIMP_LOG_WARN("Unsupported MDC file version (2 (AI_MDC_VERSION) was expected)");
  115. }
  116. if (pcHeader->ulOffsetBorderFrames + pcHeader->ulNumFrames * sizeof(MDC::Frame) > this->fileSize ||
  117. pcHeader->ulOffsetSurfaces + pcHeader->ulNumSurfaces * sizeof(MDC::Surface) > this->fileSize) {
  118. throw DeadlyImportError("Some of the offset values in the MDC header are invalid "
  119. "and point to something behind the file.");
  120. }
  121. if (this->configFrameID >= this->pcHeader->ulNumFrames) {
  122. throw DeadlyImportError("The requested frame is not available");
  123. }
  124. }
  125. // ------------------------------------------------------------------------------------------------
  126. // Validate the header of a given MDC file surface
  127. void MDCImporter::ValidateSurfaceHeader(BE_NCONST MDC::Surface *pcSurf) {
  128. AI_SWAP4(pcSurf->ulFlags);
  129. AI_SWAP4(pcSurf->ulNumCompFrames);
  130. AI_SWAP4(pcSurf->ulNumBaseFrames);
  131. AI_SWAP4(pcSurf->ulNumShaders);
  132. AI_SWAP4(pcSurf->ulNumVertices);
  133. AI_SWAP4(pcSurf->ulNumTriangles);
  134. AI_SWAP4(pcSurf->ulOffsetTriangles);
  135. AI_SWAP4(pcSurf->ulOffsetTexCoords);
  136. AI_SWAP4(pcSurf->ulOffsetBaseVerts);
  137. AI_SWAP4(pcSurf->ulOffsetCompVerts);
  138. AI_SWAP4(pcSurf->ulOffsetFrameBaseFrames);
  139. AI_SWAP4(pcSurf->ulOffsetFrameCompFrames);
  140. AI_SWAP4(pcSurf->ulOffsetEnd);
  141. const unsigned int iMax = this->fileSize - (unsigned int)((int8_t *)pcSurf - (int8_t *)pcHeader);
  142. if (pcSurf->ulOffsetBaseVerts + pcSurf->ulNumVertices * sizeof(MDC::BaseVertex) > iMax ||
  143. (pcSurf->ulNumCompFrames && pcSurf->ulOffsetCompVerts + pcSurf->ulNumVertices * sizeof(MDC::CompressedVertex) > iMax) ||
  144. pcSurf->ulOffsetTriangles + pcSurf->ulNumTriangles * sizeof(MDC::Triangle) > iMax ||
  145. pcSurf->ulOffsetTexCoords + pcSurf->ulNumVertices * sizeof(MDC::TexturCoord) > iMax ||
  146. pcSurf->ulOffsetShaders + pcSurf->ulNumShaders * sizeof(MDC::Shader) > iMax ||
  147. pcSurf->ulOffsetFrameBaseFrames + pcSurf->ulNumBaseFrames * 2 > iMax ||
  148. (pcSurf->ulNumCompFrames && pcSurf->ulOffsetFrameCompFrames + pcSurf->ulNumCompFrames * 2 > iMax)) {
  149. throw DeadlyImportError("Some of the offset values in the MDC surface header "
  150. "are invalid and point somewhere behind the file.");
  151. }
  152. }
  153. // ------------------------------------------------------------------------------------------------
  154. // Setup configuration properties
  155. void MDCImporter::SetupProperties(const Importer *pImp) {
  156. // The AI_CONFIG_IMPORT_MDC_KEYFRAME option overrides the
  157. // AI_CONFIG_IMPORT_GLOBAL_KEYFRAME option.
  158. if (static_cast<unsigned int>(-1) == (configFrameID = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_MDC_KEYFRAME, -1))) {
  159. configFrameID = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_GLOBAL_KEYFRAME, 0);
  160. }
  161. }
  162. // ------------------------------------------------------------------------------------------------
  163. // Imports the given file into the given scene structure.
  164. void MDCImporter::InternReadFile(
  165. const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler) {
  166. std::unique_ptr<IOStream> file(pIOHandler->Open(pFile));
  167. // Check whether we can read from the file
  168. if (file == nullptr) {
  169. throw DeadlyImportError("Failed to open MDC file ", pFile, ".");
  170. }
  171. // check whether the mdc file is large enough to contain the file header
  172. fileSize = static_cast<unsigned int>(file->FileSize());
  173. if (fileSize < sizeof(MDC::Header)) {
  174. throw DeadlyImportError("MDC File is too small.");
  175. }
  176. std::vector<unsigned char> mBuffer2(fileSize);
  177. file->Read(&mBuffer2[0], 1, fileSize);
  178. mBuffer = &mBuffer2[0];
  179. // validate the file header
  180. this->pcHeader = (BE_NCONST MDC::Header *)this->mBuffer;
  181. this->ValidateHeader();
  182. std::vector<std::string> aszShaders;
  183. // get a pointer to the frame we want to read
  184. BE_NCONST MDC::Frame *pcFrame = (BE_NCONST MDC::Frame *)(this->mBuffer +
  185. this->pcHeader->ulOffsetBorderFrames);
  186. // no need to swap the other members, we won't need them
  187. pcFrame += configFrameID;
  188. AI_SWAP4(pcFrame->localOrigin[0]);
  189. AI_SWAP4(pcFrame->localOrigin[1]);
  190. AI_SWAP4(pcFrame->localOrigin[2]);
  191. // get the number of valid surfaces
  192. BE_NCONST MDC::Surface *pcSurface, *pcSurface2;
  193. pcSurface = pcSurface2 = reinterpret_cast<BE_NCONST MDC::Surface *>(mBuffer + pcHeader->ulOffsetSurfaces);
  194. unsigned int iNumShaders = 0;
  195. for (unsigned int i = 0; i < pcHeader->ulNumSurfaces; ++i) {
  196. // validate the surface header
  197. this->ValidateSurfaceHeader(pcSurface2);
  198. if (pcSurface2->ulNumVertices && pcSurface2->ulNumTriangles) {
  199. ++pScene->mNumMeshes;
  200. }
  201. iNumShaders += pcSurface2->ulNumShaders;
  202. pcSurface2 = reinterpret_cast<BE_NCONST MDC::Surface *>((BE_NCONST int8_t *)pcSurface2 + pcSurface2->ulOffsetEnd);
  203. }
  204. aszShaders.reserve(iNumShaders);
  205. pScene->mMeshes = new aiMesh *[pScene->mNumMeshes];
  206. // necessary that we don't crash if an exception occurs
  207. for (unsigned int i = 0; i < pScene->mNumMeshes; ++i) {
  208. pScene->mMeshes[i] = nullptr;
  209. }
  210. // now read all surfaces
  211. unsigned int iDefaultMatIndex = UINT_MAX;
  212. for (unsigned int i = 0, iNum = 0; i < pcHeader->ulNumSurfaces; ++i) {
  213. if (!pcSurface->ulNumVertices || !pcSurface->ulNumTriangles) continue;
  214. aiMesh *pcMesh = pScene->mMeshes[iNum++] = new aiMesh();
  215. pcMesh->mNumFaces = pcSurface->ulNumTriangles;
  216. pcMesh->mNumVertices = pcMesh->mNumFaces * 3;
  217. // store the name of the surface for use as node name.
  218. pcMesh->mName.Set(std::string(pcSurface->ucName, strnlen(pcSurface->ucName, AI_MDC_MAXQPATH - 1)));
  219. // go to the first shader in the file. ignore the others.
  220. if (pcSurface->ulNumShaders) {
  221. const MDC::Shader *pcShader = (const MDC::Shader *)((int8_t *)pcSurface + pcSurface->ulOffsetShaders);
  222. pcMesh->mMaterialIndex = (unsigned int)aszShaders.size();
  223. // create a new shader
  224. aszShaders.emplace_back(pcShader->ucName,
  225. ::strnlen(pcShader->ucName, sizeof(pcShader->ucName)));
  226. }
  227. // need to create a default material
  228. else if (UINT_MAX == iDefaultMatIndex) {
  229. pcMesh->mMaterialIndex = iDefaultMatIndex = (unsigned int)aszShaders.size();
  230. aszShaders.emplace_back();
  231. }
  232. // otherwise assign a reference to the default material
  233. else
  234. pcMesh->mMaterialIndex = iDefaultMatIndex;
  235. // allocate output storage for the mesh
  236. aiVector3D *pcVertCur = pcMesh->mVertices = new aiVector3D[pcMesh->mNumVertices];
  237. aiVector3D *pcNorCur = pcMesh->mNormals = new aiVector3D[pcMesh->mNumVertices];
  238. aiVector3D *pcUVCur = pcMesh->mTextureCoords[0] = new aiVector3D[pcMesh->mNumVertices];
  239. aiFace *pcFaceCur = pcMesh->mFaces = new aiFace[pcMesh->mNumFaces];
  240. // create all vertices/faces
  241. BE_NCONST MDC::Triangle *pcTriangle = (BE_NCONST MDC::Triangle *)((int8_t *)pcSurface + pcSurface->ulOffsetTriangles);
  242. BE_NCONST MDC::TexturCoord *const pcUVs = (BE_NCONST MDC::TexturCoord *)((int8_t *)pcSurface + pcSurface->ulOffsetTexCoords);
  243. // get a pointer to the uncompressed vertices
  244. int16_t iOfs = *((int16_t *)((int8_t *)pcSurface +
  245. pcSurface->ulOffsetFrameBaseFrames) +
  246. this->configFrameID);
  247. AI_SWAP2(iOfs);
  248. BE_NCONST MDC::BaseVertex *const pcVerts = (BE_NCONST MDC::BaseVertex *)((int8_t *)pcSurface + pcSurface->ulOffsetBaseVerts) +
  249. ((int)iOfs * pcSurface->ulNumVertices * 4);
  250. // do the main swapping stuff ...
  251. #if (defined AI_BUILD_BIG_ENDIAN)
  252. // swap all triangles
  253. for (unsigned int i = 0; i < pcSurface->ulNumTriangles; ++i) {
  254. AI_SWAP4(pcTriangle[i].aiIndices[0]);
  255. AI_SWAP4(pcTriangle[i].aiIndices[1]);
  256. AI_SWAP4(pcTriangle[i].aiIndices[2]);
  257. }
  258. // swap all vertices
  259. for (unsigned int i = 0; i < pcSurface->ulNumVertices * pcSurface->ulNumBaseFrames; ++i) {
  260. AI_SWAP2(pcVerts->normal);
  261. AI_SWAP2(pcVerts->x);
  262. AI_SWAP2(pcVerts->y);
  263. AI_SWAP2(pcVerts->z);
  264. }
  265. // swap all texture coordinates
  266. for (unsigned int i = 0; i < pcSurface->ulNumVertices; ++i) {
  267. AI_SWAP4(pcUVs->u);
  268. AI_SWAP4(pcUVs->v);
  269. }
  270. #endif
  271. const MDC::CompressedVertex *pcCVerts = nullptr;
  272. int16_t *mdcCompVert = nullptr;
  273. // access compressed frames for large frame numbers, but never for the first
  274. if (this->configFrameID && pcSurface->ulNumCompFrames > 0) {
  275. mdcCompVert = (int16_t *)((int8_t *)pcSurface + pcSurface->ulOffsetFrameCompFrames) + this->configFrameID;
  276. AI_SWAP2P(mdcCompVert);
  277. if (*mdcCompVert >= 0) {
  278. pcCVerts = (const MDC::CompressedVertex *)((int8_t *)pcSurface +
  279. pcSurface->ulOffsetCompVerts) +
  280. *mdcCompVert * pcSurface->ulNumVertices;
  281. } else
  282. mdcCompVert = nullptr;
  283. }
  284. // copy all faces
  285. for (unsigned int iFace = 0; iFace < pcSurface->ulNumTriangles; ++iFace,
  286. ++pcTriangle, ++pcFaceCur) {
  287. const unsigned int iOutIndex = iFace * 3;
  288. pcFaceCur->mNumIndices = 3;
  289. pcFaceCur->mIndices = new unsigned int[3];
  290. for (unsigned int iIndex = 0; iIndex < 3; ++iIndex,
  291. ++pcVertCur, ++pcUVCur, ++pcNorCur) {
  292. uint32_t quak = pcTriangle->aiIndices[iIndex];
  293. if (quak >= pcSurface->ulNumVertices) {
  294. ASSIMP_LOG_ERROR("MDC vertex index is out of range");
  295. quak = pcSurface->ulNumVertices - 1;
  296. }
  297. // compressed vertices?
  298. if (mdcCompVert) {
  299. MDC::BuildVertex(*pcFrame, pcVerts[quak], pcCVerts[quak],
  300. *pcVertCur, *pcNorCur);
  301. } else {
  302. // copy position
  303. pcVertCur->x = pcVerts[quak].x * AI_MDC_BASE_SCALING;
  304. pcVertCur->y = pcVerts[quak].y * AI_MDC_BASE_SCALING;
  305. pcVertCur->z = pcVerts[quak].z * AI_MDC_BASE_SCALING;
  306. // copy normals
  307. MD3::LatLngNormalToVec3(pcVerts[quak].normal, &pcNorCur->x);
  308. // copy texture coordinates
  309. pcUVCur->x = pcUVs[quak].u;
  310. pcUVCur->y = ai_real(1.0) - pcUVs[quak].v; // DX to OGL
  311. }
  312. pcVertCur->x += pcFrame->localOrigin[0];
  313. pcVertCur->y += pcFrame->localOrigin[1];
  314. pcVertCur->z += pcFrame->localOrigin[2];
  315. }
  316. // swap the face order - DX to OGL
  317. pcFaceCur->mIndices[0] = iOutIndex + 2;
  318. pcFaceCur->mIndices[1] = iOutIndex + 1;
  319. pcFaceCur->mIndices[2] = iOutIndex + 0;
  320. }
  321. pcSurface = reinterpret_cast<BE_NCONST MDC::Surface *>((BE_NCONST int8_t *)pcSurface + pcSurface->ulOffsetEnd);
  322. }
  323. // create a flat node graph with a root node and one child for each surface
  324. if (!pScene->mNumMeshes)
  325. throw DeadlyImportError("Invalid MDC file: File contains no valid mesh");
  326. else if (1 == pScene->mNumMeshes) {
  327. pScene->mRootNode = new aiNode();
  328. if (nullptr != pScene->mMeshes[0]) {
  329. pScene->mRootNode->mName = pScene->mMeshes[0]->mName;
  330. pScene->mRootNode->mNumMeshes = 1;
  331. pScene->mRootNode->mMeshes = new unsigned int[1];
  332. pScene->mRootNode->mMeshes[0] = 0;
  333. }
  334. } else {
  335. pScene->mRootNode = new aiNode();
  336. pScene->mRootNode->mNumChildren = pScene->mNumMeshes;
  337. pScene->mRootNode->mChildren = new aiNode *[pScene->mNumMeshes];
  338. pScene->mRootNode->mName.Set("<root>");
  339. for (unsigned int i = 0; i < pScene->mNumMeshes; ++i) {
  340. aiNode *pcNode = pScene->mRootNode->mChildren[i] = new aiNode();
  341. pcNode->mParent = pScene->mRootNode;
  342. pcNode->mName = pScene->mMeshes[i]->mName;
  343. pcNode->mNumMeshes = 1;
  344. pcNode->mMeshes = new unsigned int[1];
  345. pcNode->mMeshes[0] = i;
  346. }
  347. }
  348. // create materials
  349. pScene->mNumMaterials = (unsigned int)aszShaders.size();
  350. pScene->mMaterials = new aiMaterial *[pScene->mNumMaterials];
  351. for (unsigned int i = 0; i < pScene->mNumMaterials; ++i) {
  352. aiMaterial *pcMat = new aiMaterial();
  353. pScene->mMaterials[i] = pcMat;
  354. const std::string &name = aszShaders[i];
  355. int iMode = (int)aiShadingMode_Gouraud;
  356. pcMat->AddProperty<int>(&iMode, 1, AI_MATKEY_SHADING_MODEL);
  357. // add a small ambient color value - RtCW seems to have one
  358. aiColor3D clr;
  359. clr.b = clr.g = clr.r = 0.05f;
  360. pcMat->AddProperty<aiColor3D>(&clr, 1, AI_MATKEY_COLOR_AMBIENT);
  361. if (name.length())
  362. clr.b = clr.g = clr.r = 1.0f;
  363. else
  364. clr.b = clr.g = clr.r = 0.6f;
  365. pcMat->AddProperty<aiColor3D>(&clr, 1, AI_MATKEY_COLOR_DIFFUSE);
  366. pcMat->AddProperty<aiColor3D>(&clr, 1, AI_MATKEY_COLOR_SPECULAR);
  367. if (name.length()) {
  368. aiString path;
  369. path.Set(name);
  370. pcMat->AddProperty(&path, AI_MATKEY_TEXTURE_DIFFUSE(0));
  371. }
  372. }
  373. // Now rotate the whole scene 90 degrees around the x axis to convert to internal coordinate system
  374. pScene->mRootNode->mTransformation = aiMatrix4x4(
  375. 1.f, 0.f, 0.f, 0.f,
  376. 0.f, 0.f, 1.f, 0.f,
  377. 0.f, -1.f, 0.f, 0.f,
  378. 0.f, 0.f, 0.f, 1.f);
  379. }
  380. #endif // !! ASSIMP_BUILD_NO_MDC_IMPORTER