├── .gitattributes ├── .gitignore ├── Config └── FilterPlugin.ini ├── Content ├── Example │ ├── Gameplay │ │ ├── RML_GameMode.uasset │ │ └── RML_PlayerController.uasset │ ├── Maps │ │ └── RML_ExampleMap.umap │ ├── RML_CustomMesh.uasset │ ├── RML_GameMode.uasset │ ├── RML_UserWidget.uasset │ ├── RuntimeMeshLoader │ │ ├── RML_BaseMaterial.uasset │ │ └── RML_CustomMesh.uasset │ └── UI │ │ ├── RML_ListEntry.uasset │ │ └── RML_UserWidget.uasset └── Example_4.20 │ ├── RML_BaseMateria_ue420.uasset │ ├── RML_ExampleMap_ue420.umap │ ├── example_ue420_bp.uasset │ └── pic.uasset ├── LICENSE ├── README.md ├── Resources ├── Freighter │ ├── AssetInfo.txt │ ├── Freighter.fbx │ ├── Freighter_N.png │ └── Freighter_T.png ├── Gun │ ├── AssetInfo.txt │ ├── Gun.fbx │ ├── Gun_N.png │ └── Gun_T.png └── Icon128.png ├── RuntimeMeshLoader.uplugin ├── Source └── RuntimeMeshLoader │ ├── Private │ ├── MeshLoader.cpp │ └── RuntimeMeshLoader.cpp │ ├── Public │ ├── MeshLoader.h │ └── RuntimeMeshLoader.h │ └── RuntimeMeshLoader.Build.cs └── ThirdParty └── assimp ├── bin ├── assimp-vc142-mt.dll ├── assimp.exe ├── unit.exe └── zlib.dll ├── include └── assimp │ ├── .editorconfig │ ├── BaseImporter.h │ ├── Bitmap.h │ ├── BlobIOSystem.h │ ├── ByteSwapper.h │ ├── Compiler │ ├── poppack1.h │ ├── pstdint.h │ └── pushpack1.h │ ├── CreateAnimMesh.h │ ├── DefaultIOStream.h │ ├── DefaultIOSystem.h │ ├── DefaultLogger.hpp │ ├── Defines.h │ ├── Exceptional.h │ ├── Exporter.hpp │ ├── GenericProperty.h │ ├── Hash.h │ ├── IOStream.hpp │ ├── IOStreamBuffer.h │ ├── IOSystem.hpp │ ├── Importer.hpp │ ├── LineSplitter.h │ ├── LogAux.h │ ├── LogStream.hpp │ ├── Logger.hpp │ ├── Macros.h │ ├── MathFunctions.h │ ├── MemoryIOWrapper.h │ ├── NullLogger.hpp │ ├── ParsingUtils.h │ ├── Profiler.h │ ├── ProgressHandler.hpp │ ├── RemoveComments.h │ ├── SGSpatialSort.h │ ├── SceneCombiner.h │ ├── SkeletonMeshBuilder.h │ ├── SmoothingGroups.h │ ├── SmoothingGroups.inl │ ├── SpatialSort.h │ ├── StandardShapes.h │ ├── StreamReader.h │ ├── StreamWriter.h │ ├── StringComparison.h │ ├── StringUtils.h │ ├── Subdivision.h │ ├── TinyFormatter.h │ ├── Vertex.h │ ├── XMLTools.h │ ├── ZipArchiveIOSystem.h │ ├── aabb.h │ ├── ai_assert.h │ ├── anim.h │ ├── camera.h │ ├── cexport.h │ ├── cfileio.h │ ├── cimport.h │ ├── color4.h │ ├── color4.inl │ ├── config.h │ ├── config.h.in │ ├── defs.h │ ├── fast_atof.h │ ├── importerdesc.h │ ├── irrXMLWrapper.h │ ├── light.h │ ├── material.h │ ├── material.inl │ ├── matrix3x3.h │ ├── matrix3x3.inl │ ├── matrix4x4.h │ ├── matrix4x4.inl │ ├── mesh.h │ ├── metadata.h │ ├── pbrmaterial.h │ ├── port │ └── AndroidJNI │ │ └── AndroidJNIIOSystem.h │ ├── postprocess.h │ ├── qnan.h │ ├── quaternion.h │ ├── quaternion.inl │ ├── scene.h │ ├── texture.h │ ├── types.h │ ├── vector2.h │ ├── vector2.inl │ ├── vector3.h │ ├── vector3.inl │ └── version.h └── lib ├── IrrXML.lib ├── assimp-vc142-mt.exp ├── assimp-vc142-mt.lib ├── libassimp.so ├── zlib.exp ├── zlib.lib └── zlibstatic.lib /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Visual Studio 2015 user specific files 2 | .vs/ 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | 22 | # Compiled Static libraries 23 | *.lai 24 | *.la 25 | *.a 26 | *.lib 27 | 28 | # Executables 29 | *.exe 30 | *.out 31 | *.app 32 | *.ipa 33 | 34 | # These project files can be generated by the engine 35 | *.xcodeproj 36 | *.xcworkspace 37 | *.sln 38 | *.suo 39 | *.opensdf 40 | *.sdf 41 | *.VC.db 42 | *.VC.opendb 43 | 44 | # Precompiled Assets 45 | SourceArt/**/*.png 46 | SourceArt/**/*.tga 47 | 48 | # Binary Files 49 | Binaries/* 50 | 51 | # Builds 52 | Build/* 53 | 54 | # Whitelist PakBlacklist-.txt files 55 | !Build/*/ 56 | Build/*/** 57 | !Build/*/PakBlacklist*.txt 58 | 59 | # Don't ignore icon files in Build 60 | !Build/**/*.ico 61 | 62 | # Built data for maps 63 | *_BuiltData.uasset 64 | 65 | # Configuration files generated by the Editor 66 | Saved/* 67 | 68 | # Compiled source files for the engine to use 69 | Intermediate/* 70 | !ThirdParty/assimp/** 71 | 72 | # Cache files for the editor to use 73 | DerivedDataCache/* 74 | -------------------------------------------------------------------------------- /Config/FilterPlugin.ini: -------------------------------------------------------------------------------- 1 | [FilterPlugin] 2 | ; This section lists additional files which will be packaged along with your plugin. Paths should be listed relative to the root plugin directory, and 3 | ; may include "...", "*", and "?" wildcards to match directories, files, and individual characters respectively. 4 | ; 5 | ; Examples: 6 | ; /README.txt 7 | ; /Extras/... 8 | ; /Binaries/ThirdParty/*.dll 9 | -------------------------------------------------------------------------------- /Content/Example/Gameplay/RML_GameMode.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/Content/Example/Gameplay/RML_GameMode.uasset -------------------------------------------------------------------------------- /Content/Example/Gameplay/RML_PlayerController.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/Content/Example/Gameplay/RML_PlayerController.uasset -------------------------------------------------------------------------------- /Content/Example/Maps/RML_ExampleMap.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/Content/Example/Maps/RML_ExampleMap.umap -------------------------------------------------------------------------------- /Content/Example/RML_CustomMesh.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/Content/Example/RML_CustomMesh.uasset -------------------------------------------------------------------------------- /Content/Example/RML_GameMode.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/Content/Example/RML_GameMode.uasset -------------------------------------------------------------------------------- /Content/Example/RML_UserWidget.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/Content/Example/RML_UserWidget.uasset -------------------------------------------------------------------------------- /Content/Example/RuntimeMeshLoader/RML_BaseMaterial.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/Content/Example/RuntimeMeshLoader/RML_BaseMaterial.uasset -------------------------------------------------------------------------------- /Content/Example/RuntimeMeshLoader/RML_CustomMesh.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/Content/Example/RuntimeMeshLoader/RML_CustomMesh.uasset -------------------------------------------------------------------------------- /Content/Example/UI/RML_ListEntry.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/Content/Example/UI/RML_ListEntry.uasset -------------------------------------------------------------------------------- /Content/Example/UI/RML_UserWidget.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/Content/Example/UI/RML_UserWidget.uasset -------------------------------------------------------------------------------- /Content/Example_4.20/RML_BaseMateria_ue420.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/Content/Example_4.20/RML_BaseMateria_ue420.uasset -------------------------------------------------------------------------------- /Content/Example_4.20/RML_ExampleMap_ue420.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/Content/Example_4.20/RML_ExampleMap_ue420.umap -------------------------------------------------------------------------------- /Content/Example_4.20/example_ue420_bp.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/Content/Example_4.20/example_ue420_bp.uasset -------------------------------------------------------------------------------- /Content/Example_4.20/pic.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/Content/Example_4.20/pic.uasset -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Christopher Jürges 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | Mentioning the author of this plugin (Christopher Sebastian Jürges) would be 15 | nice and appreciated. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | RuntimeMeshLoader 2 | ================== 3 | A pluging for Unreal Engine 4 and Unreal Engine 5, which allows to import meshes during runtime. 4 | 5 | This is a fork of the original [RuntimeMeshLoader repository](https://github.com/GameInstitute/RuntimeMeshLoader). 6 | 7 | Additionally, functiones were added to import and apply textures for the meshes. 8 | 9 | RuntimeMeshLoader (RML) uses [Assimp](https://github.com/assimp/assimp) as a third-party library to handle most of the import-stuff. 10 | 11 | ## Table of contents 12 | * [Supported operating systems](#supported-operating-systems) 13 | * [Supported Unreal Enginge versions](#supported-unreal-enginge-versions) 14 | * [Installation](#installation) 15 | * [How-to](#how-to) 16 | * [Limitations](#limitations) 17 | 18 | 19 | ## Supported operating systems 20 | Currently, Windows (x64) as well as Linux (Ubuntu 20) have been verified. 21 | 22 | ## Supported Unreal Enginge versions 23 | The Plugin was tested under Unreal Engine v. 4.25.3 as well as version 5 (Early Access). However, any modern version of Unreal Engine should be compatible with it. 24 | 25 | ## Installation 26 | Download this repository, by clicking on the green `Code`-Button in the upper right hand corner and select `Download ZIP`. 27 | 28 | In your Unreal Enginge project open the `Plugins` directory. If it does not exist, simply create a new folder in the root directory of your project and call it `Plugins`. 29 | 30 | Copy the contents of the former downloaded ZIP-folder into it. The folder might have a name such as `RuntimeMeshLoader-main`. If that is the case, rename it to `RuntimeMeshLoader`. 31 | 32 | Afterwards, load up your project. Unreal Enginge might tell you it needs to rebuild the Plugin. Simply click on `Yes`. After the rebuild process your project should load as usual. 33 | 34 | In your projec's `source panel` you should now have a folder labeled `RuntimeMeshLoader Content`. Inside you will find an example map, which will show you how to use the plugin with an example. 35 | 36 | ## How-to 37 | The plugin can be used in many ways. You could create a file-dialogue for the user to select his assets to be loaded, or by loading assets from a pre-defined folder, or any other creative way. 38 | 39 | In the example map, a folder called `RuntimeMeshLoader` is created in the user's `Documents` folder. Inside this folder, the plugin expects for each asset to be loaded a separate folder, in which 3 files should be located. `.fbx`, `_T.png` and `_N.png`, which are the mesh itself as an fbx-file, its texture and its normal map as PNG-files. 40 | 41 | If you load up the plugin for the first time, the folder will be empty. As an example, you can copy the two provided mesh-folders inside the `Resources` directory into the aforementioned `RuntimeMeshLoader`-folder. 42 | 43 | ## Limitations 44 | Only PNG-formats can be loaded. JPG is currently not supported. 45 | 46 | In the example map, only fbx-files are supported. However, the plugin is already capable of laoding a lot more 3D-file formats. 47 | 48 | I often run into problems with loading fbx-files downloaded from the internet. Usually, opening it up in Blender and exporting it again solved it for me. 49 | -------------------------------------------------------------------------------- /Resources/Freighter/AssetInfo.txt: -------------------------------------------------------------------------------- 1 | The asset was downloaded from https://free3d.com/3d-model/si-fi-freighter-13915.html and further exporter using blender as the provided FBX-format did not work with the importer. -------------------------------------------------------------------------------- /Resources/Freighter/Freighter.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/Resources/Freighter/Freighter.fbx -------------------------------------------------------------------------------- /Resources/Freighter/Freighter_N.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/Resources/Freighter/Freighter_N.png -------------------------------------------------------------------------------- /Resources/Freighter/Freighter_T.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/Resources/Freighter/Freighter_T.png -------------------------------------------------------------------------------- /Resources/Gun/AssetInfo.txt: -------------------------------------------------------------------------------- 1 | The asset was downloaded from https://free3d.com/3d-model/45-acp-smith-and-wesson-13999.html and further exporter using blender as the provided FBX-format did not work with the importer. -------------------------------------------------------------------------------- /Resources/Gun/Gun.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/Resources/Gun/Gun.fbx -------------------------------------------------------------------------------- /Resources/Gun/Gun_N.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/Resources/Gun/Gun_N.png -------------------------------------------------------------------------------- /Resources/Gun/Gun_T.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/Resources/Gun/Gun_T.png -------------------------------------------------------------------------------- /Resources/Icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/Resources/Icon128.png -------------------------------------------------------------------------------- /RuntimeMeshLoader.uplugin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/RuntimeMeshLoader.uplugin -------------------------------------------------------------------------------- /Source/RuntimeMeshLoader/Private/MeshLoader.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "MeshLoader.h" 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include "Modules/ModuleManager.h" 11 | #include "Misc/FileHelper.h" 12 | #include "IImageWrapper.h" 13 | #include "Runtime/ImageWrapper/Public/IImageWrapperModule.h" 14 | #include "HAL/FileManager.h" 15 | #include "HAL/FileManagerGeneric.h" 16 | 17 | FMeshData ProcessMesh(aiMesh* Mesh, const aiScene* Scene) 18 | { 19 | FMeshData MeshData; 20 | 21 | for (uint32 j = 0; j < Mesh->mNumVertices; ++j) 22 | { 23 | FVector Vertex = FVector(Mesh->mVertices[j].x, Mesh->mVertices[j].y, Mesh->mVertices[j].z); 24 | MeshData.Vertices.Add(Vertex); 25 | FVector Normal = FVector::ZeroVector; 26 | 27 | if (Mesh->HasNormals()) 28 | { 29 | Normal = FVector(Mesh->mNormals[j].x, Mesh->mNormals[j].y, Mesh->mNormals[j].z); 30 | } 31 | MeshData.Normals.Add(Normal); 32 | if (Mesh->mTextureCoords[0]) 33 | { 34 | MeshData.UVs.Add(FVector2D(static_cast(Mesh->mTextureCoords[0][j].x), 1.f-static_cast(Mesh->mTextureCoords[0][j].y))); 35 | } 36 | 37 | if (Mesh->HasTangentsAndBitangents()) 38 | { 39 | FProcMeshTangent Tangent = FProcMeshTangent(Mesh->mTangents[j].x, Mesh->mTangents[j].y, Mesh->mTangents[j].z); 40 | MeshData.Tangents.Add(Tangent); 41 | } 42 | } 43 | 44 | UE_LOG(LogTemp, Log, TEXT("mNumFaces: %d"), Mesh->mNumFaces); 45 | for (uint32 i = 0; i < Mesh->mNumFaces; i++) 46 | { 47 | aiFace Face = Mesh->mFaces[i]; 48 | for (uint32 f = 0; f < Face.mNumIndices; f++) 49 | { 50 | MeshData.Triangles.Add(Face.mIndices[f]); 51 | } 52 | } 53 | 54 | return MeshData; 55 | } 56 | 57 | void ProcessNode(aiNode* Node, const aiScene* Scene, int ParentNodeIndex, int* CurrentIndex, FFinalReturnData* FinalReturnData) 58 | { 59 | FNodeData NodeData; 60 | NodeData.NodeParentIndex = ParentNodeIndex; 61 | 62 | 63 | aiMatrix4x4 TempTrans = Node->mTransformation; 64 | FMatrix tempMatrix; 65 | tempMatrix.M[0][0] = TempTrans.a1; tempMatrix.M[0][1] = TempTrans.b1; tempMatrix.M[0][2] = TempTrans.c1; tempMatrix.M[0][3] = TempTrans.d1; 66 | tempMatrix.M[1][0] = TempTrans.a2; tempMatrix.M[1][1] = TempTrans.b2; tempMatrix.M[1][2] = TempTrans.c2; tempMatrix.M[1][3] = TempTrans.d2; 67 | tempMatrix.M[2][0] = TempTrans.a3; tempMatrix.M[2][1] = TempTrans.b3; tempMatrix.M[2][2] = TempTrans.c3; tempMatrix.M[2][3] = TempTrans.d3; 68 | tempMatrix.M[3][0] = TempTrans.a4; tempMatrix.M[3][1] = TempTrans.b4; tempMatrix.M[3][2] = TempTrans.c4; tempMatrix.M[3][3] = TempTrans.d4; 69 | NodeData.RelativeTransformTransform = FTransform(tempMatrix); 70 | 71 | for (uint32 n = 0; n < Node->mNumMeshes; n++) 72 | { 73 | uint32 MeshIndex = Node->mMeshes[n]; 74 | UE_LOG(LogTemp, Log, TEXT("Loading Mesh at index: %d"), MeshIndex); 75 | aiMesh* Mesh = Scene->mMeshes[MeshIndex]; 76 | NodeData.Meshes.Add(ProcessMesh(Mesh, Scene)); 77 | } 78 | 79 | FinalReturnData->Nodes.Add(NodeData); 80 | 81 | UE_LOG(LogTemp, Log, TEXT("mNumMeshes: %d, mNumChildren of Node: %d"), Node->mNumMeshes, Node->mNumChildren); 82 | int CurrentParentIndex = *CurrentIndex; 83 | for (uint32 n = 0; n < Node->mNumChildren; n++) 84 | { 85 | (*CurrentIndex)++; 86 | ProcessNode(Node->mChildren[n], Scene, CurrentParentIndex, CurrentIndex, FinalReturnData); 87 | } 88 | } 89 | 90 | FFinalReturnData UMeshLoader::LoadMeshFromFile(FString FilePath, EPathType type) 91 | { 92 | FFinalReturnData ReturnData; 93 | ReturnData.Success = false; 94 | 95 | if (FilePath.IsEmpty()) 96 | { 97 | UE_LOG(LogTemp, Warning, TEXT("Runtime Mesh Loader: filepath is empty.\n")); 98 | return ReturnData; 99 | } 100 | 101 | std::string FinalFilePath; 102 | switch (type) 103 | { 104 | case EPathType::Absolute: 105 | FinalFilePath = TCHAR_TO_UTF8(*FilePath); 106 | break; 107 | case EPathType::Relative: 108 | FinalFilePath = TCHAR_TO_UTF8(*FPaths::Combine(FPaths::ProjectContentDir(), FilePath)); 109 | break; 110 | } 111 | 112 | Assimp::Importer mImporter; 113 | 114 | const aiScene* Scene = mImporter.ReadFile(FinalFilePath.c_str(), aiProcess_Triangulate | aiProcess_MakeLeftHanded | aiProcess_CalcTangentSpace | aiProcess_GenSmoothNormals | aiProcess_OptimizeMeshes); 115 | 116 | if (Scene == nullptr) 117 | { 118 | UE_LOG(LogTemp, Warning, TEXT("Runtime Mesh Loader: Read mesh file failure.\n")); 119 | return ReturnData; 120 | } 121 | 122 | if (Scene->HasMeshes()) 123 | { 124 | int NodeIndex = 0; 125 | int* NodeIndexPtr = &NodeIndex; 126 | ProcessNode(Scene->mRootNode, Scene, -1, NodeIndexPtr, &ReturnData); 127 | 128 | ReturnData.Success = true; 129 | } 130 | 131 | return ReturnData; 132 | } 133 | 134 | bool UMeshLoader::DirectoryExists(FString DirectoryPath) 135 | { 136 | return FPaths::DirectoryExists(DirectoryPath); 137 | } 138 | 139 | bool UMeshLoader::CreateDirectory(FString DirectoryPath) 140 | { 141 | IPlatformFile& PlatformFile = FPlatformFileManager::Get().GetPlatformFile(); 142 | 143 | if (!PlatformFile.DirectoryExists(*DirectoryPath)) 144 | { 145 | return PlatformFile.CreateDirectoryTree(*DirectoryPath); 146 | } 147 | 148 | return true; 149 | } 150 | 151 | TArray UMeshLoader::ListFolders(FString DirectoryPath) 152 | { 153 | TArray Folders; 154 | FFileManagerGeneric::Get().FindFilesRecursive(Folders, *DirectoryPath, TEXT("*"), false, true, true); 155 | return Folders; 156 | } 157 | 158 | UTexture2D* UMeshLoader::LoadTexture2DFromFile(const FString& FullFilePath, bool& IsValid, int32& Width, int32& Height) 159 | { 160 | IsValid = false; 161 | UTexture2D* LoadedT2D = NULL; 162 | 163 | IImageWrapperModule& ImageWrapperModule = FModuleManager::LoadModuleChecked(FName("ImageWrapper")); 164 | 165 | TSharedPtr ImageWrapper = ImageWrapperModule.CreateImageWrapper(EImageFormat::PNG); 166 | 167 | //Load From File 168 | TArray RawFileData; 169 | /*If you use lower unreal engine,for example the version is 4.20,you may get a error message in bulid,you should use The following code replace "TArray RawFileData;" 170 | const TArray* UncompressedBGRA = NULL;*/ 171 | 172 | if (!FFileHelper::LoadFileToArray(RawFileData, * FullFilePath)) 173 | { 174 | return NULL; 175 | } 176 | 177 | 178 | //Create T2D! 179 | if (ImageWrapper.IsValid() && ImageWrapper->SetCompressed(RawFileData.GetData(), RawFileData.Num())) 180 | { 181 | TArray UncompressedBGRA; 182 | if (ImageWrapper->GetRaw(ERGBFormat::BGRA, 8, UncompressedBGRA)) 183 | { 184 | LoadedT2D = UTexture2D::CreateTransient(ImageWrapper->GetWidth(), ImageWrapper->GetHeight(), PF_B8G8R8A8); 185 | 186 | //Valid? 187 | if (!LoadedT2D) 188 | { 189 | return NULL; 190 | } 191 | 192 | //Out! 193 | Width = ImageWrapper->GetWidth(); 194 | Height = ImageWrapper->GetHeight(); 195 | 196 | //Copy! 197 | void* TextureData = LoadedT2D->PlatformData->Mips[0].BulkData.Lock(LOCK_READ_WRITE); 198 | FMemory::Memcpy(TextureData, UncompressedBGRA.GetData(), UncompressedBGRA.Num()); 199 | /*if you use the code"const TArray* UncompressedBGRA = NULL;",Accordingly, since UncompressedBGRA becomes a pointer, you need to use a pointer reference method, like this 200 | FMemory::Memcpy(TextureData, UncompressedBGRA->GetData(), UncompressedBGRA->Num());*/ 201 | LoadedT2D->PlatformData->Mips[0].BulkData.Unlock(); 202 | 203 | //Update! 204 | LoadedT2D->UpdateResource(); 205 | } 206 | } 207 | 208 | // Success! 209 | IsValid = true; 210 | return LoadedT2D; 211 | } 212 | -------------------------------------------------------------------------------- /Source/RuntimeMeshLoader/Private/RuntimeMeshLoader.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "RuntimeMeshLoader.h" 4 | 5 | #include "Interfaces/IPluginManager.h" 6 | 7 | #define LOCTEXT_NAMESPACE "FRuntimeMeshLoaderModule" 8 | 9 | void FRuntimeMeshLoaderModule::StartupModule() 10 | { 11 | // This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module 12 | FString s = IPluginManager::Get().FindPlugin("RuntimeMeshLoader")->GetBaseDir(); 13 | UE_LOG(LogTemp, Log, TEXT("%s"), *s); 14 | DllHandle = FPlatformProcess::GetDllHandle(*(IPluginManager::Get().FindPlugin("RuntimeMeshLoader")->GetBaseDir() + "\\ThirdParty\\assimp\\bin\\assimp-vc142-mt.dll")); 15 | } 16 | 17 | void FRuntimeMeshLoaderModule::ShutdownModule() 18 | { 19 | // This function may be called during shutdown to clean up your module. For modules that support dynamic reloading, 20 | // we call this function before unloading the module. 21 | FPlatformProcess::FreeDllHandle(DllHandle); 22 | } 23 | 24 | #undef LOCTEXT_NAMESPACE 25 | 26 | IMPLEMENT_MODULE(FRuntimeMeshLoaderModule, RuntimeMeshLoader) -------------------------------------------------------------------------------- /Source/RuntimeMeshLoader/Public/MeshLoader.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | 7 | #include "ProceduralMeshComponent.h" 8 | #include "Kismet/BlueprintFunctionLibrary.h" 9 | #include "MeshLoader.generated.h" 10 | 11 | UENUM(BlueprintType) 12 | enum class EPathType : uint8 13 | { 14 | Absolute, 15 | Relative 16 | }; 17 | 18 | 19 | USTRUCT(BlueprintType) 20 | struct FMeshData 21 | { 22 | GENERATED_USTRUCT_BODY() 23 | 24 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "FinalReturnData") 25 | TArray Vertices; 26 | 27 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "FinalReturnData") 28 | TArray Triangles; 29 | 30 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "FinalReturnData") 31 | TArray Normals; 32 | 33 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "FinalReturnData") 34 | TArray UVs; 35 | 36 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "FinalReturnData") 37 | TArray Tangents; 38 | }; 39 | 40 | USTRUCT(BlueprintType) 41 | struct FNodeData 42 | { 43 | GENERATED_USTRUCT_BODY() 44 | 45 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "FinalReturnData") 46 | FTransform RelativeTransformTransform; 47 | 48 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "FinalReturnData") 49 | int NodeParentIndex; 50 | 51 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "FinalReturnData") 52 | TArray Meshes; 53 | }; 54 | 55 | USTRUCT(BlueprintType) 56 | struct FFinalReturnData 57 | { 58 | GENERATED_USTRUCT_BODY() 59 | 60 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "FinalReturnData") 61 | bool Success; 62 | 63 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "FinalReturnData") 64 | TArray Nodes; 65 | }; 66 | 67 | /** 68 | * 69 | */ 70 | UCLASS() 71 | class RUNTIMEMESHLOADER_API UMeshLoader : public UBlueprintFunctionLibrary 72 | { 73 | GENERATED_BODY() 74 | 75 | UFUNCTION(BlueprintCallable,Category="RuntimeMeshLoader") 76 | static FFinalReturnData LoadMeshFromFile(FString FilePath, EPathType type = EPathType::Absolute); 77 | 78 | UFUNCTION(BlueprintCallable,Category="RuntimeMeshLoader") 79 | static bool DirectoryExists(FString DirectoryPath); 80 | 81 | UFUNCTION(BlueprintCallable,Category="RuntimeMeshLoader") 82 | static bool CreateDirectory(FString DirectoryPath); 83 | 84 | UFUNCTION(BlueprintCallable,Category="RuntimeMeshLoader") 85 | static TArray ListFolders(FString DirectoryPath); 86 | 87 | UFUNCTION(BlueprintCallable,Category="RuntimeMeshLoader") 88 | static UTexture2D* LoadTexture2DFromFile(const FString& FullFilePath, bool& IsValid, int32& Width, int32& Height); 89 | }; 90 | -------------------------------------------------------------------------------- /Source/RuntimeMeshLoader/Public/RuntimeMeshLoader.h: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Modules/ModuleManager.h" 7 | 8 | class FRuntimeMeshLoaderModule : public IModuleInterface 9 | { 10 | public: 11 | void* DllHandle; 12 | /** IModuleInterface implementation */ 13 | virtual void StartupModule() override; 14 | virtual void ShutdownModule() override; 15 | }; 16 | -------------------------------------------------------------------------------- /Source/RuntimeMeshLoader/RuntimeMeshLoader.Build.cs: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | using UnrealBuildTool; 4 | using System.IO; 5 | 6 | public class RuntimeMeshLoader : ModuleRules 7 | { 8 | public RuntimeMeshLoader(ReadOnlyTargetRules Target) : base(Target) 9 | { 10 | PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; 11 | var thirdPartyPath = Path.GetFullPath(Path.Combine(ModuleDirectory, "..", "..", "ThirdParty")); 12 | 13 | PublicIncludePaths.AddRange( 14 | new string[] { 15 | Path.Combine(thirdPartyPath, "assimp", "include") 16 | // ... add public include paths required here ... 17 | } 18 | ); 19 | 20 | 21 | PrivateIncludePaths.AddRange( 22 | new string[] { 23 | // ... add other private include paths required here ... 24 | } 25 | ); 26 | 27 | 28 | PublicDependencyModuleNames.AddRange( 29 | new string[] 30 | { 31 | "Core", 32 | "ProceduralMeshComponent" 33 | // ... add other public dependencies that you statically link with here ... 34 | } 35 | ); 36 | 37 | 38 | PrivateDependencyModuleNames.AddRange( 39 | new string[] 40 | { 41 | "CoreUObject", 42 | "Engine", 43 | "Slate", 44 | "SlateCore", 45 | "Projects" 46 | // ... add private dependencies that you statically link with here ... 47 | } 48 | ); 49 | 50 | 51 | DynamicallyLoadedModuleNames.AddRange( 52 | new string[] 53 | { 54 | // ... add any modules that your module loads dynamically here ... 55 | } 56 | ); 57 | 58 | PublicDelayLoadDLLs.Add("assimp-vc142-mt.dll"); 59 | 60 | if (Target.Platform == UnrealTargetPlatform.Win64) 61 | { 62 | PublicAdditionalLibraries.Add(Path.Combine(thirdPartyPath, "assimp\\lib", "assimp-vc142-mt.lib")); 63 | 64 | RuntimeDependencies.Add(Path.Combine(thirdPartyPath, "assimp\\bin", "assimp-vc142-mt.dll")); 65 | } 66 | 67 | if (Target.Platform == UnrealTargetPlatform.Linux) 68 | { 69 | var AssimpLib = Path.Combine(ModuleDirectory, "..", "..", "ThirdParty", "assimp", "lib", "libassimp.so"); 70 | 71 | PublicAdditionalLibraries.Add(AssimpLib); 72 | 73 | RuntimeDependencies.Add(AssimpLib); 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /ThirdParty/assimp/bin/assimp-vc142-mt.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/ThirdParty/assimp/bin/assimp-vc142-mt.dll -------------------------------------------------------------------------------- /ThirdParty/assimp/bin/assimp.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/ThirdParty/assimp/bin/assimp.exe -------------------------------------------------------------------------------- /ThirdParty/assimp/bin/unit.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/ThirdParty/assimp/bin/unit.exe -------------------------------------------------------------------------------- /ThirdParty/assimp/bin/zlib.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/ThirdParty/assimp/bin/zlib.dll -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/.editorconfig: -------------------------------------------------------------------------------- 1 | # See for details 2 | 3 | [*.{h,hpp,inl}] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | trim_trailing_whitespace = true 7 | indent_size = 4 8 | indent_style = space 9 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/Bitmap.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2019, assimp team 7 | 8 | 9 | 10 | All rights reserved. 11 | 12 | Redistribution and use of this software in source and binary forms, 13 | with or without modification, are permitted provided that the following 14 | conditions are met: 15 | 16 | * Redistributions of source code must retain the above 17 | copyright notice, this list of conditions and the 18 | following disclaimer. 19 | 20 | * Redistributions in binary form must reproduce the above 21 | copyright notice, this list of conditions and the 22 | following disclaimer in the documentation and/or other 23 | materials provided with the distribution. 24 | 25 | * Neither the name of the assimp team, nor the names of its 26 | contributors may be used to endorse or promote products 27 | derived from this software without specific prior 28 | written permission of the assimp team. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | --------------------------------------------------------------------------- 42 | */ 43 | 44 | /** @file Bitmap.h 45 | * @brief Defines bitmap format helper for textures 46 | * 47 | * Used for file formats which embed their textures into the model file. 48 | */ 49 | 50 | #ifndef AI_BITMAP_H_INC 51 | #define AI_BITMAP_H_INC 52 | 53 | #include "defs.h" 54 | #include 55 | #include 56 | 57 | struct aiTexture; 58 | 59 | namespace Assimp { 60 | 61 | class IOStream; 62 | 63 | class ASSIMP_API Bitmap { 64 | protected: 65 | 66 | struct Header { 67 | uint16_t type; 68 | uint32_t size; 69 | uint16_t reserved1; 70 | uint16_t reserved2; 71 | uint32_t offset; 72 | 73 | // We define the struct size because sizeof(Header) might return a wrong result because of structure padding. 74 | // Moreover, we must use this ugly and error prone syntax because Visual Studio neither support constexpr or sizeof(name_of_field). 75 | static const std::size_t header_size = 76 | sizeof(uint16_t) + // type 77 | sizeof(uint32_t) + // size 78 | sizeof(uint16_t) + // reserved1 79 | sizeof(uint16_t) + // reserved2 80 | sizeof(uint32_t); // offset 81 | }; 82 | 83 | struct DIB { 84 | uint32_t size; 85 | int32_t width; 86 | int32_t height; 87 | uint16_t planes; 88 | uint16_t bits_per_pixel; 89 | uint32_t compression; 90 | uint32_t image_size; 91 | int32_t x_resolution; 92 | int32_t y_resolution; 93 | uint32_t nb_colors; 94 | uint32_t nb_important_colors; 95 | 96 | // We define the struct size because sizeof(DIB) might return a wrong result because of structure padding. 97 | // Moreover, we must use this ugly and error prone syntax because Visual Studio neither support constexpr or sizeof(name_of_field). 98 | static const std::size_t dib_size = 99 | sizeof(uint32_t) + // size 100 | sizeof(int32_t) + // width 101 | sizeof(int32_t) + // height 102 | sizeof(uint16_t) + // planes 103 | sizeof(uint16_t) + // bits_per_pixel 104 | sizeof(uint32_t) + // compression 105 | sizeof(uint32_t) + // image_size 106 | sizeof(int32_t) + // x_resolution 107 | sizeof(int32_t) + // y_resolution 108 | sizeof(uint32_t) + // nb_colors 109 | sizeof(uint32_t); // nb_important_colors 110 | }; 111 | 112 | static const std::size_t mBytesPerPixel = 4; 113 | 114 | public: 115 | static void Save(aiTexture* texture, IOStream* file); 116 | 117 | protected: 118 | static void WriteHeader(Header& header, IOStream* file); 119 | static void WriteDIB(DIB& dib, IOStream* file); 120 | static void WriteData(aiTexture* texture, IOStream* file); 121 | }; 122 | 123 | } 124 | 125 | #endif // AI_BITMAP_H_INC 126 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/Compiler/poppack1.h: -------------------------------------------------------------------------------- 1 | 2 | // =============================================================================== 3 | // May be included multiple times - resets structure packing to the defaults 4 | // for all supported compilers. Reverts the changes made by #include 5 | // 6 | // Currently this works on the following compilers: 7 | // MSVC 7,8,9 8 | // GCC 9 | // BORLAND (complains about 'pack state changed but not reverted', but works) 10 | // =============================================================================== 11 | 12 | #ifndef AI_PUSHPACK_IS_DEFINED 13 | # error pushpack1.h must be included after poppack1.h 14 | #endif 15 | 16 | // reset packing to the original value 17 | #if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__) 18 | # pragma pack( pop ) 19 | #endif 20 | #undef PACK_STRUCT 21 | 22 | #undef AI_PUSHPACK_IS_DEFINED 23 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/Compiler/pushpack1.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // =============================================================================== 4 | // May be included multiple times - sets structure packing to 1 5 | // for all supported compilers. #include reverts the changes. 6 | // 7 | // Currently this works on the following compilers: 8 | // MSVC 7,8,9 9 | // GCC 10 | // BORLAND (complains about 'pack state changed but not reverted', but works) 11 | // Clang 12 | // 13 | // 14 | // USAGE: 15 | // 16 | // struct StructToBePacked { 17 | // } PACK_STRUCT; 18 | // 19 | // =============================================================================== 20 | 21 | #ifdef AI_PUSHPACK_IS_DEFINED 22 | # error poppack1.h must be included after pushpack1.h 23 | #endif 24 | 25 | #if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__) 26 | # pragma pack(push,1) 27 | # define PACK_STRUCT 28 | #elif defined( __GNUC__ ) || defined(__clang__) 29 | # if !defined(HOST_MINGW) 30 | # define PACK_STRUCT __attribute__((__packed__)) 31 | # else 32 | # define PACK_STRUCT __attribute__((gcc_struct, __packed__)) 33 | # endif 34 | #else 35 | # error Compiler not supported 36 | #endif 37 | 38 | #if defined(_MSC_VER) 39 | // C4103: Packing was changed after the inclusion of the header, probably missing #pragma pop 40 | # pragma warning (disable : 4103) 41 | #endif 42 | 43 | #define AI_PUSHPACK_IS_DEFINED 44 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/CreateAnimMesh.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2019, assimp team 6 | 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use of this software in source and binary forms, 11 | with or without modification, are permitted provided that the 12 | following conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the 20 | following disclaimer in the documentation and/or other 21 | materials provided with the distribution. 22 | 23 | * Neither the name of the assimp team, nor the names of its 24 | contributors may be used to endorse or promote products 25 | derived from this software without specific prior 26 | written permission of the assimp team. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | 40 | ---------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file CreateAnimMesh.h 44 | * Create AnimMesh from Mesh 45 | */ 46 | #ifndef INCLUDED_AI_CREATE_ANIM_MESH_H 47 | #define INCLUDED_AI_CREATE_ANIM_MESH_H 48 | 49 | #include 50 | 51 | namespace Assimp { 52 | 53 | /** Create aiAnimMesh from aiMesh. */ 54 | ASSIMP_API aiAnimMesh *aiCreateAnimMesh(const aiMesh *mesh); 55 | 56 | } // end of namespace Assimp 57 | #endif // INCLUDED_AI_CREATE_ANIM_MESH_H 58 | 59 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/DefaultIOStream.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2019, assimp team 6 | 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use of this software in source and binary forms, 11 | with or without modification, are permitted provided that the 12 | following conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the 20 | following disclaimer in the documentation and/or other 21 | materials provided with the distribution. 22 | 23 | * Neither the name of the assimp team, nor the names of its 24 | contributors may be used to endorse or promote products 25 | derived from this software without specific prior 26 | written permission of the assimp team. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | 40 | ---------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file Default file I/O using fXXX()-family of functions */ 44 | #ifndef AI_DEFAULTIOSTREAM_H_INC 45 | #define AI_DEFAULTIOSTREAM_H_INC 46 | 47 | #include 48 | #include 49 | #include 50 | #include 51 | 52 | namespace Assimp { 53 | 54 | // ---------------------------------------------------------------------------------- 55 | //! @class DefaultIOStream 56 | //! @brief Default IO implementation, use standard IO operations 57 | //! @note An instance of this class can exist without a valid file handle 58 | //! attached to it. All calls fail, but the instance can nevertheless be 59 | //! used with no restrictions. 60 | class ASSIMP_API DefaultIOStream : public IOStream 61 | { 62 | friend class DefaultIOSystem; 63 | #if __ANDROID__ 64 | # if __ANDROID_API__ > 9 65 | # if defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT) 66 | friend class AndroidJNIIOSystem; 67 | # endif // defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT) 68 | # endif // __ANDROID_API__ > 9 69 | #endif // __ANDROID__ 70 | 71 | protected: 72 | DefaultIOStream() AI_NO_EXCEPT; 73 | DefaultIOStream(FILE* pFile, const std::string &strFilename); 74 | 75 | public: 76 | /** Destructor public to allow simple deletion to close the file. */ 77 | ~DefaultIOStream (); 78 | 79 | // ------------------------------------------------------------------- 80 | /// Read from stream 81 | size_t Read(void* pvBuffer, 82 | size_t pSize, 83 | size_t pCount); 84 | 85 | 86 | // ------------------------------------------------------------------- 87 | /// Write to stream 88 | size_t Write(const void* pvBuffer, 89 | size_t pSize, 90 | size_t pCount); 91 | 92 | // ------------------------------------------------------------------- 93 | /// Seek specific position 94 | aiReturn Seek(size_t pOffset, 95 | aiOrigin pOrigin); 96 | 97 | // ------------------------------------------------------------------- 98 | /// Get current seek position 99 | size_t Tell() const; 100 | 101 | // ------------------------------------------------------------------- 102 | /// Get size of file 103 | size_t FileSize() const; 104 | 105 | // ------------------------------------------------------------------- 106 | /// Flush file contents 107 | void Flush(); 108 | 109 | private: 110 | // File data-structure, using clib 111 | FILE* mFile; 112 | // Filename 113 | std::string mFilename; 114 | // Cached file size 115 | mutable size_t mCachedSize; 116 | }; 117 | 118 | // ---------------------------------------------------------------------------------- 119 | inline 120 | DefaultIOStream::DefaultIOStream() AI_NO_EXCEPT 121 | : mFile(nullptr) 122 | , mFilename("") 123 | , mCachedSize(SIZE_MAX) { 124 | // empty 125 | } 126 | 127 | // ---------------------------------------------------------------------------------- 128 | inline 129 | DefaultIOStream::DefaultIOStream (FILE* pFile, const std::string &strFilename) 130 | : mFile(pFile) 131 | , mFilename(strFilename) 132 | , mCachedSize(SIZE_MAX) { 133 | // empty 134 | } 135 | // ---------------------------------------------------------------------------------- 136 | 137 | } // ns assimp 138 | 139 | #endif //!!AI_DEFAULTIOSTREAM_H_INC 140 | 141 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/DefaultIOSystem.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2019, assimp team 6 | 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use of this software in source and binary forms, 11 | with or without modification, are permitted provided that the 12 | following conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the 20 | following disclaimer in the documentation and/or other 21 | materials provided with the distribution. 22 | 23 | * Neither the name of the assimp team, nor the names of its 24 | contributors may be used to endorse or promote products 25 | derived from this software without specific prior 26 | written permission of the assimp team. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | 40 | ---------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file Default implementation of IOSystem using the standard C file functions */ 44 | #ifndef AI_DEFAULTIOSYSTEM_H_INC 45 | #define AI_DEFAULTIOSYSTEM_H_INC 46 | 47 | #include 48 | 49 | namespace Assimp { 50 | 51 | // --------------------------------------------------------------------------- 52 | /** Default implementation of IOSystem using the standard C file functions */ 53 | class ASSIMP_API DefaultIOSystem : public IOSystem { 54 | public: 55 | // ------------------------------------------------------------------- 56 | /** Tests for the existence of a file at the given path. */ 57 | bool Exists( const char* pFile) const; 58 | 59 | // ------------------------------------------------------------------- 60 | /** Returns the directory separator. */ 61 | char getOsSeparator() const; 62 | 63 | // ------------------------------------------------------------------- 64 | /** Open a new file with a given path. */ 65 | IOStream* Open( const char* pFile, const char* pMode = "rb"); 66 | 67 | // ------------------------------------------------------------------- 68 | /** Closes the given file and releases all resources associated with it. */ 69 | void Close( IOStream* pFile); 70 | 71 | // ------------------------------------------------------------------- 72 | /** Compare two paths */ 73 | bool ComparePaths (const char* one, const char* second) const; 74 | 75 | /** @brief get the file name of a full filepath 76 | * example: /tmp/archive.tar.gz -> archive.tar.gz 77 | */ 78 | static std::string fileName( const std::string &path ); 79 | 80 | /** @brief get the complete base name of a full filepath 81 | * example: /tmp/archive.tar.gz -> archive.tar 82 | */ 83 | static std::string completeBaseName( const std::string &path); 84 | 85 | /** @brief get the path of a full filepath 86 | * example: /tmp/archive.tar.gz -> /tmp/ 87 | */ 88 | static std::string absolutePath( const std::string &path); 89 | }; 90 | 91 | } //!ns Assimp 92 | 93 | #endif //AI_DEFAULTIOSYSTEM_H_INC 94 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/Defines.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2012, assimp team 6 | All rights reserved. 7 | 8 | Redistribution and use of this software in source and binary forms, 9 | with or without modification, are permitted provided that the 10 | following conditions are met: 11 | 12 | * Redistributions of source code must retain the above 13 | copyright notice, this list of conditions and the 14 | following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above 17 | copyright notice, this list of conditions and the 18 | following disclaimer in the documentation and/or other 19 | materials provided with the distribution. 20 | 21 | * Neither the name of the assimp team, nor the names of its 22 | contributors may be used to endorse or promote products 23 | derived from this software without specific prior 24 | written permission of the assimp team. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 29 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 30 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 32 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | 38 | ---------------------------------------------------------------------- 39 | */ 40 | 41 | // We need those constants, workaround for any platforms where nobody defined them yet 42 | #if (!defined SIZE_MAX) 43 | # define SIZE_MAX (~((size_t)0)) 44 | #endif 45 | 46 | #if (!defined UINT_MAX) 47 | # define UINT_MAX (~((unsigned int)0)) 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/Exceptional.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2008, assimp team 6 | All rights reserved. 7 | 8 | Redistribution and use of this software in source and binary forms, 9 | with or without modification, are permitted provided that the 10 | following conditions are met: 11 | 12 | * Redistributions of source code must retain the above 13 | copyright notice, this list of conditions and the 14 | following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above 17 | copyright notice, this list of conditions and the 18 | following disclaimer in the documentation and/or other 19 | materials provided with the distribution. 20 | 21 | * Neither the name of the assimp team, nor the names of its 22 | contributors may be used to endorse or promote products 23 | derived from this software without specific prior 24 | written permission of the assimp team. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 29 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 30 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 32 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | 38 | ---------------------------------------------------------------------- 39 | */ 40 | 41 | #ifndef INCLUDED_EXCEPTIONAL_H 42 | #define INCLUDED_EXCEPTIONAL_H 43 | 44 | #include 45 | #include 46 | using std::runtime_error; 47 | 48 | #ifdef _MSC_VER 49 | # pragma warning(disable : 4275) 50 | #endif 51 | 52 | // --------------------------------------------------------------------------- 53 | /** FOR IMPORTER PLUGINS ONLY: Simple exception class to be thrown if an 54 | * unrecoverable error occurs while importing. Loading APIs return 55 | * NULL instead of a valid aiScene then. */ 56 | class DeadlyImportError 57 | : public runtime_error 58 | { 59 | public: 60 | /** Constructor with arguments */ 61 | explicit DeadlyImportError( const std::string& errorText) 62 | : runtime_error(errorText) 63 | { 64 | } 65 | 66 | private: 67 | }; 68 | 69 | typedef DeadlyImportError DeadlyExportError; 70 | 71 | #ifdef _MSC_VER 72 | # pragma warning(default : 4275) 73 | #endif 74 | 75 | // --------------------------------------------------------------------------- 76 | template 77 | struct ExceptionSwallower { 78 | T operator ()() const { 79 | return T(); 80 | } 81 | }; 82 | 83 | // --------------------------------------------------------------------------- 84 | template 85 | struct ExceptionSwallower { 86 | T* operator ()() const { 87 | return NULL; 88 | } 89 | }; 90 | 91 | // --------------------------------------------------------------------------- 92 | template <> 93 | struct ExceptionSwallower { 94 | aiReturn operator ()() const { 95 | try { 96 | throw; 97 | } 98 | catch (std::bad_alloc&) { 99 | return aiReturn_OUTOFMEMORY; 100 | } 101 | catch (...) { 102 | return aiReturn_FAILURE; 103 | } 104 | } 105 | }; 106 | 107 | // --------------------------------------------------------------------------- 108 | template <> 109 | struct ExceptionSwallower { 110 | void operator ()() const { 111 | return; 112 | } 113 | }; 114 | 115 | #define ASSIMP_BEGIN_EXCEPTION_REGION()\ 116 | {\ 117 | try { 118 | 119 | #define ASSIMP_END_EXCEPTION_REGION(type)\ 120 | } catch(...) {\ 121 | return ExceptionSwallower()();\ 122 | }\ 123 | } 124 | 125 | #endif // INCLUDED_EXCEPTIONAL_H 126 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/GenericProperty.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2019, assimp team 6 | 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use of this software in source and binary forms, 11 | with or without modification, are permitted provided that the 12 | following conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the 20 | following disclaimer in the documentation and/or other 21 | materials provided with the distribution. 22 | 23 | * Neither the name of the assimp team, nor the names of its 24 | contributors may be used to endorse or promote products 25 | derived from this software without specific prior 26 | written permission of the assimp team. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | 40 | ---------------------------------------------------------------------- 41 | */ 42 | 43 | #ifndef AI_GENERIC_PROPERTY_H_INCLUDED 44 | #define AI_GENERIC_PROPERTY_H_INCLUDED 45 | 46 | #include 47 | #include 48 | #include "Hash.h" 49 | 50 | #include 51 | 52 | // ------------------------------------------------------------------------------------------------ 53 | template 54 | inline 55 | bool SetGenericProperty(std::map< unsigned int, T >& list, 56 | const char* szName, const T& value) { 57 | ai_assert(nullptr != szName); 58 | const uint32_t hash = SuperFastHash(szName); 59 | 60 | typename std::map::iterator it = list.find(hash); 61 | if (it == list.end()) { 62 | list.insert(std::pair( hash, value )); 63 | return false; 64 | } 65 | (*it).second = value; 66 | 67 | return true; 68 | } 69 | 70 | // ------------------------------------------------------------------------------------------------ 71 | template 72 | inline 73 | const T& GetGenericProperty(const std::map< unsigned int, T >& list, 74 | const char* szName, const T& errorReturn) { 75 | ai_assert(nullptr != szName); 76 | const uint32_t hash = SuperFastHash(szName); 77 | 78 | typename std::map::const_iterator it = list.find(hash); 79 | if (it == list.end()) { 80 | return errorReturn; 81 | } 82 | 83 | return (*it).second; 84 | } 85 | 86 | // ------------------------------------------------------------------------------------------------ 87 | // Special version for pointer types - they will be deleted when replaced with another value 88 | // passing NULL removes the whole property 89 | template 90 | inline 91 | void SetGenericPropertyPtr(std::map< unsigned int, T* >& list, 92 | const char* szName, T* value, bool* bWasExisting = nullptr ) { 93 | ai_assert(nullptr != szName); 94 | const uint32_t hash = SuperFastHash(szName); 95 | 96 | typename std::map::iterator it = list.find(hash); 97 | if (it == list.end()) { 98 | if (bWasExisting) { 99 | *bWasExisting = false; 100 | } 101 | 102 | list.insert(std::pair( hash, value )); 103 | return; 104 | } 105 | if ((*it).second != value) { 106 | delete (*it).second; 107 | (*it).second = value; 108 | } 109 | if (!value) { 110 | list.erase(it); 111 | } 112 | if (bWasExisting) { 113 | *bWasExisting = true; 114 | } 115 | } 116 | 117 | // ------------------------------------------------------------------------------------------------ 118 | template 119 | inline 120 | bool HasGenericProperty(const std::map< unsigned int, T >& list, 121 | const char* szName) { 122 | ai_assert(nullptr != szName); 123 | const uint32_t hash = SuperFastHash(szName); 124 | 125 | typename std::map::const_iterator it = list.find(hash); 126 | if (it == list.end()) { 127 | return false; 128 | } 129 | 130 | return true; 131 | } 132 | 133 | #endif // !! AI_GENERIC_PROPERTY_H_INCLUDED 134 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/Hash.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2019, assimp team 6 | 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use of this software in source and binary forms, 11 | with or without modification, are permitted provided that the 12 | following conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the 20 | following disclaimer in the documentation and/or other 21 | materials provided with the distribution. 22 | 23 | * Neither the name of the assimp team, nor the names of its 24 | contributors may be used to endorse or promote products 25 | derived from this software without specific prior 26 | written permission of the assimp team. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | 40 | ---------------------------------------------------------------------- 41 | */ 42 | 43 | #ifndef AI_HASH_H_INCLUDED 44 | #define AI_HASH_H_INCLUDED 45 | 46 | #include 47 | #include 48 | 49 | // ------------------------------------------------------------------------------------------------ 50 | // Hashing function taken from 51 | // http://www.azillionmonkeys.com/qed/hash.html 52 | // (incremental version) 53 | // 54 | // This code is Copyright 2004-2008 by Paul Hsieh. It is used here in the belief that 55 | // Assimp's license is considered compatible with Pauls's derivative license as specified 56 | // on his web page. 57 | // 58 | // (stdint.h should have been been included here) 59 | // ------------------------------------------------------------------------------------------------ 60 | #undef get16bits 61 | #if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \ 62 | || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__) 63 | #define get16bits(d) (*((const uint16_t *) (d))) 64 | #endif 65 | 66 | #if !defined (get16bits) 67 | #define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\ 68 | +(uint32_t)(((const uint8_t *)(d))[0]) ) 69 | #endif 70 | 71 | // ------------------------------------------------------------------------------------------------ 72 | inline uint32_t SuperFastHash (const char * data, uint32_t len = 0, uint32_t hash = 0) { 73 | uint32_t tmp; 74 | int rem; 75 | 76 | if (!data) return 0; 77 | if (!len)len = (uint32_t)::strlen(data); 78 | 79 | rem = len & 3; 80 | len >>= 2; 81 | 82 | /* Main loop */ 83 | for (;len > 0; len--) { 84 | hash += get16bits (data); 85 | tmp = (get16bits (data+2) << 11) ^ hash; 86 | hash = (hash << 16) ^ tmp; 87 | data += 2*sizeof (uint16_t); 88 | hash += hash >> 11; 89 | } 90 | 91 | /* Handle end cases */ 92 | switch (rem) { 93 | case 3: hash += get16bits (data); 94 | hash ^= hash << 16; 95 | hash ^= data[sizeof (uint16_t)] << 18; 96 | hash += hash >> 11; 97 | break; 98 | case 2: hash += get16bits (data); 99 | hash ^= hash << 11; 100 | hash += hash >> 17; 101 | break; 102 | case 1: hash += *data; 103 | hash ^= hash << 10; 104 | hash += hash >> 1; 105 | } 106 | 107 | /* Force "avalanching" of final 127 bits */ 108 | hash ^= hash << 3; 109 | hash += hash >> 5; 110 | hash ^= hash << 4; 111 | hash += hash >> 17; 112 | hash ^= hash << 25; 113 | hash += hash >> 6; 114 | 115 | return hash; 116 | } 117 | 118 | #endif // !! AI_HASH_H_INCLUDED 119 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/IOStream.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2019, assimp team 7 | 8 | 9 | 10 | All rights reserved. 11 | 12 | Redistribution and use of this software in source and binary forms, 13 | with or without modification, are permitted provided that the following 14 | conditions are met: 15 | 16 | * Redistributions of source code must retain the above 17 | copyright notice, this list of conditions and the 18 | following disclaimer. 19 | 20 | * Redistributions in binary form must reproduce the above 21 | copyright notice, this list of conditions and the 22 | following disclaimer in the documentation and/or other 23 | materials provided with the distribution. 24 | 25 | * Neither the name of the assimp team, nor the names of its 26 | contributors may be used to endorse or promote products 27 | derived from this software without specific prior 28 | written permission of the assimp team. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | --------------------------------------------------------------------------- 42 | */ 43 | /** @file IOStream.hpp 44 | * @brief File I/O wrappers for C++. 45 | */ 46 | 47 | #pragma once 48 | #ifndef AI_IOSTREAM_H_INC 49 | #define AI_IOSTREAM_H_INC 50 | 51 | #include "types.h" 52 | 53 | #ifndef __cplusplus 54 | # error This header requires C++ to be used. aiFileIO.h is the \ 55 | corresponding C interface. 56 | #endif 57 | 58 | namespace Assimp { 59 | 60 | // ---------------------------------------------------------------------------------- 61 | /** @brief CPP-API: Class to handle file I/O for C++ 62 | * 63 | * Derive an own implementation from this interface to provide custom IO handling 64 | * to the Importer. If you implement this interface, be sure to also provide an 65 | * implementation for IOSystem that creates instances of your custom IO class. 66 | */ 67 | class ASSIMP_API IOStream 68 | #ifndef SWIG 69 | : public Intern::AllocateFromAssimpHeap 70 | #endif 71 | { 72 | protected: 73 | /** Constructor protected, use IOSystem::Open() to create an instance. */ 74 | IOStream() AI_NO_EXCEPT; 75 | 76 | public: 77 | // ------------------------------------------------------------------- 78 | /** @brief Destructor. Deleting the object closes the underlying file, 79 | * alternatively you may use IOSystem::Close() to release the file. 80 | */ 81 | virtual ~IOStream(); 82 | 83 | // ------------------------------------------------------------------- 84 | /** @brief Read from the file 85 | * 86 | * See fread() for more details 87 | * This fails for write-only files */ 88 | virtual size_t Read(void* pvBuffer, 89 | size_t pSize, 90 | size_t pCount) = 0; 91 | 92 | // ------------------------------------------------------------------- 93 | /** @brief Write to the file 94 | * 95 | * See fwrite() for more details 96 | * This fails for read-only files */ 97 | virtual size_t Write(const void* pvBuffer, 98 | size_t pSize, 99 | size_t pCount) = 0; 100 | 101 | // ------------------------------------------------------------------- 102 | /** @brief Set the read/write cursor of the file 103 | * 104 | * Note that the offset is _negative_ for aiOrigin_END. 105 | * See fseek() for more details */ 106 | virtual aiReturn Seek(size_t pOffset, 107 | aiOrigin pOrigin) = 0; 108 | 109 | // ------------------------------------------------------------------- 110 | /** @brief Get the current position of the read/write cursor 111 | * 112 | * See ftell() for more details */ 113 | virtual size_t Tell() const = 0; 114 | 115 | // ------------------------------------------------------------------- 116 | /** @brief Returns filesize 117 | * Returns the filesize. */ 118 | virtual size_t FileSize() const = 0; 119 | 120 | // ------------------------------------------------------------------- 121 | /** @brief Flush the contents of the file buffer (for writers) 122 | * See fflush() for more details. 123 | */ 124 | virtual void Flush() = 0; 125 | }; //! class IOStream 126 | 127 | // ---------------------------------------------------------------------------------- 128 | inline 129 | IOStream::IOStream() AI_NO_EXCEPT { 130 | // empty 131 | } 132 | 133 | // ---------------------------------------------------------------------------------- 134 | inline 135 | IOStream::~IOStream() { 136 | // empty 137 | } 138 | // ---------------------------------------------------------------------------------- 139 | 140 | } //!namespace Assimp 141 | 142 | #endif //!!AI_IOSTREAM_H_INC 143 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/LogAux.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2019, assimp team 6 | 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use of this software in source and binary forms, 11 | with or without modification, are permitted provided that the 12 | following conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the 20 | following disclaimer in the documentation and/or other 21 | materials provided with the distribution. 22 | 23 | * Neither the name of the assimp team, nor the names of its 24 | contributors may be used to endorse or promote products 25 | derived from this software without specific prior 26 | written permission of the assimp team. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | 40 | ---------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file LogAux.h 44 | * @brief Common logging usage patterns for importer implementations 45 | */ 46 | #ifndef INCLUDED_AI_LOGAUX_H 47 | #define INCLUDED_AI_LOGAUX_H 48 | 49 | #include 50 | #include 51 | #include 52 | 53 | namespace Assimp { 54 | 55 | template 56 | class LogFunctions { 57 | public: 58 | // ------------------------------------------------------------------------------------------------ 59 | static void ThrowException(const std::string& msg) 60 | { 61 | throw DeadlyImportError(Prefix()+msg); 62 | } 63 | 64 | // ------------------------------------------------------------------------------------------------ 65 | static void LogWarn(const Formatter::format& message) { 66 | if (!DefaultLogger::isNullLogger()) { 67 | ASSIMP_LOG_WARN(Prefix()+(std::string)message); 68 | } 69 | } 70 | 71 | // ------------------------------------------------------------------------------------------------ 72 | static void LogError(const Formatter::format& message) { 73 | if (!DefaultLogger::isNullLogger()) { 74 | ASSIMP_LOG_ERROR(Prefix()+(std::string)message); 75 | } 76 | } 77 | 78 | // ------------------------------------------------------------------------------------------------ 79 | static void LogInfo(const Formatter::format& message) { 80 | if (!DefaultLogger::isNullLogger()) { 81 | ASSIMP_LOG_INFO(Prefix()+(std::string)message); 82 | } 83 | } 84 | 85 | // ------------------------------------------------------------------------------------------------ 86 | static void LogDebug(const Formatter::format& message) { 87 | if (!DefaultLogger::isNullLogger()) { 88 | ASSIMP_LOG_DEBUG(Prefix()+(std::string)message); 89 | } 90 | } 91 | 92 | // https://sourceforge.net/tracker/?func=detail&atid=1067632&aid=3358562&group_id=226462 93 | #if !defined(__GNUC__) || !defined(__APPLE__) || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) 94 | 95 | // ------------------------------------------------------------------------------------------------ 96 | static void LogWarn (const char* message) { 97 | if (!DefaultLogger::isNullLogger()) { 98 | LogWarn(Formatter::format(message)); 99 | } 100 | } 101 | 102 | // ------------------------------------------------------------------------------------------------ 103 | static void LogError (const char* message) { 104 | if (!DefaultLogger::isNullLogger()) { 105 | LogError(Formatter::format(message)); 106 | } 107 | } 108 | 109 | // ------------------------------------------------------------------------------------------------ 110 | static void LogInfo (const char* message) { 111 | if (!DefaultLogger::isNullLogger()) { 112 | LogInfo(Formatter::format(message)); 113 | } 114 | } 115 | 116 | // ------------------------------------------------------------------------------------------------ 117 | static void LogDebug (const char* message) { 118 | if (!DefaultLogger::isNullLogger()) { 119 | LogDebug(Formatter::format(message)); 120 | } 121 | } 122 | 123 | #endif 124 | 125 | private: 126 | static const char* Prefix(); 127 | 128 | }; 129 | } // ! Assimp 130 | 131 | #endif 132 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/LogStream.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2019, assimp team 6 | 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use of this software in source and binary forms, 11 | with or without modification, are permitted provided that the 12 | following conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the 20 | following disclaimer in the documentation and/or other 21 | materials provided with the distribution. 22 | 23 | * Neither the name of the assimp team, nor the names of its 24 | contributors may be used to endorse or promote products 25 | derived from this software without specific prior 26 | written permission of the assimp team. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | 40 | ---------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file LogStream.hpp 44 | * @brief Abstract base class 'LogStream', representing an output log stream. 45 | */ 46 | #ifndef INCLUDED_AI_LOGSTREAM_H 47 | #define INCLUDED_AI_LOGSTREAM_H 48 | 49 | #include "types.h" 50 | 51 | namespace Assimp { 52 | 53 | class IOSystem; 54 | 55 | // ------------------------------------------------------------------------------------ 56 | /** @brief CPP-API: Abstract interface for log stream implementations. 57 | * 58 | * Several default implementations are provided, see #aiDefaultLogStream for more 59 | * details. Writing your own implementation of LogStream is just necessary if these 60 | * are not enough for your purpose. */ 61 | class ASSIMP_API LogStream 62 | #ifndef SWIG 63 | : public Intern::AllocateFromAssimpHeap 64 | #endif 65 | { 66 | protected: 67 | /** @brief Default constructor */ 68 | LogStream() AI_NO_EXCEPT; 69 | 70 | public: 71 | /** @brief Virtual destructor */ 72 | virtual ~LogStream(); 73 | 74 | // ------------------------------------------------------------------- 75 | /** @brief Overwrite this for your own output methods 76 | * 77 | * Log messages *may* consist of multiple lines and you shouldn't 78 | * expect a consistent formatting. If you want custom formatting 79 | * (e.g. generate HTML), supply a custom instance of Logger to 80 | * #DefaultLogger:set(). Usually you can *expect* that a log message 81 | * is exactly one line and terminated with a single \n character. 82 | * @param message Message to be written */ 83 | virtual void write(const char* message) = 0; 84 | 85 | // ------------------------------------------------------------------- 86 | /** @brief Creates a default log stream 87 | * @param streams Type of the default stream 88 | * @param name For aiDefaultLogStream_FILE: name of the output file 89 | * @param io For aiDefaultLogStream_FILE: IOSystem to be used to open the output 90 | * file. Pass NULL for the default implementation. 91 | * @return New LogStream instance. */ 92 | static LogStream* createDefaultStream(aiDefaultLogStream stream, 93 | const char* name = "AssimpLog.txt", 94 | IOSystem* io = nullptr ); 95 | 96 | }; // !class LogStream 97 | 98 | inline 99 | LogStream::LogStream() AI_NO_EXCEPT { 100 | // empty 101 | } 102 | 103 | inline 104 | LogStream::~LogStream() { 105 | // empty 106 | } 107 | 108 | // ------------------------------------------------------------------------------------ 109 | } // Namespace Assimp 110 | 111 | #endif 112 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/Macros.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2019, assimp team 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use of this software in source and binary forms, 11 | with or without modification, are permitted provided that the following 12 | conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the 20 | following disclaimer in the documentation and/or other 21 | materials provided with the distribution. 22 | 23 | * Neither the name of the assimp team, nor the names of its 24 | contributors may be used to endorse or promote products 25 | derived from this software without specific prior 26 | written permission of the assimp team. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | --------------------------------------------------------------------------- 40 | */ 41 | 42 | /* Helper macro to set a pointer to NULL in debug builds 43 | */ 44 | #if (defined ASSIMP_BUILD_DEBUG) 45 | # define AI_DEBUG_INVALIDATE_PTR(x) x = NULL; 46 | #else 47 | # define AI_DEBUG_INVALIDATE_PTR(x) 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/MathFunctions.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2016, assimp team 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use of this software in source and binary forms, 11 | with or without modification, are permitted provided that the following 12 | conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the 20 | following disclaimer in the documentation and/or other 21 | materials provided with the distribution. 22 | 23 | * Neither the name of the assimp team, nor the names of its 24 | contributors may be used to endorse or promote products 25 | derived from this software without specific prior 26 | written permission of the assimp team. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | --------------------------------------------------------------------------- 40 | */ 41 | 42 | #pragma once 43 | 44 | /** @file MathFunctions.h 45 | * @brief Implementation of math utility functions. 46 | * 47 | */ 48 | 49 | #include 50 | 51 | namespace Assimp { 52 | namespace Math { 53 | 54 | // TODO: use binary GCD for unsigned integers .... 55 | template < typename IntegerType > 56 | inline 57 | IntegerType gcd( IntegerType a, IntegerType b ) { 58 | const IntegerType zero = (IntegerType)0; 59 | while ( true ) { 60 | if ( a == zero ) 61 | return b; 62 | b %= a; 63 | 64 | if ( b == zero ) 65 | return a; 66 | a %= b; 67 | } 68 | } 69 | 70 | template < typename IntegerType > 71 | inline 72 | IntegerType lcm( IntegerType a, IntegerType b ) { 73 | const IntegerType t = gcd (a,b); 74 | if (!t) 75 | return t; 76 | return a / t * b; 77 | } 78 | 79 | template 80 | inline 81 | T getEpsilon() { 82 | return std::numeric_limits::epsilon(); 83 | } 84 | 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/NullLogger.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2019, assimp team 6 | 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use of this software in source and binary forms, 11 | with or without modification, are permitted provided that the 12 | following conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the 20 | following disclaimer in the documentation and/or other 21 | materials provided with the distribution. 22 | 23 | * Neither the name of the assimp team, nor the names of its 24 | contributors may be used to endorse or promote products 25 | derived from this software without specific prior 26 | written permission of the assimp team. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | 40 | ---------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file NullLogger.hpp 44 | * @brief Dummy logger 45 | */ 46 | 47 | #ifndef INCLUDED_AI_NULLLOGGER_H 48 | #define INCLUDED_AI_NULLLOGGER_H 49 | 50 | #include "Logger.hpp" 51 | 52 | namespace Assimp { 53 | 54 | // --------------------------------------------------------------------------- 55 | /** @brief CPP-API: Empty logging implementation. 56 | * 57 | * Does nothing! Used by default if the application hasn't requested a 58 | * custom logger via #DefaultLogger::set() or #DefaultLogger::create(); */ 59 | class ASSIMP_API NullLogger 60 | : public Logger { 61 | 62 | public: 63 | 64 | /** @brief Logs a debug message */ 65 | void OnDebug(const char* message) { 66 | (void)message; //this avoids compiler warnings 67 | } 68 | 69 | /** @brief Logs an info message */ 70 | void OnInfo(const char* message) { 71 | (void)message; //this avoids compiler warnings 72 | } 73 | 74 | /** @brief Logs a warning message */ 75 | void OnWarn(const char* message) { 76 | (void)message; //this avoids compiler warnings 77 | } 78 | 79 | /** @brief Logs an error message */ 80 | void OnError(const char* message) { 81 | (void)message; //this avoids compiler warnings 82 | } 83 | 84 | /** @brief Detach a still attached stream from logger */ 85 | bool attachStream(LogStream *pStream, unsigned int severity) { 86 | (void)pStream; (void)severity; //this avoids compiler warnings 87 | return false; 88 | } 89 | 90 | /** @brief Detach a still attached stream from logger */ 91 | bool detatchStream(LogStream *pStream, unsigned int severity) { 92 | (void)pStream; (void)severity; //this avoids compiler warnings 93 | return false; 94 | } 95 | 96 | private: 97 | }; 98 | } 99 | #endif // !! AI_NULLLOGGER_H_INCLUDED 100 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/Profiler.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2019, assimp team 6 | 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use of this software in source and binary forms, 11 | with or without modification, are permitted provided that the 12 | following conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the 20 | following disclaimer in the documentation and/or other 21 | materials provided with the distribution. 22 | 23 | * Neither the name of the assimp team, nor the names of its 24 | contributors may be used to endorse or promote products 25 | derived from this software without specific prior 26 | written permission of the assimp team. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | 40 | ---------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file Profiler.h 44 | * @brief Utility to measure the respective runtime of each import step 45 | */ 46 | #ifndef INCLUDED_PROFILER_H 47 | #define INCLUDED_PROFILER_H 48 | 49 | #include 50 | #include 51 | #include "TinyFormatter.h" 52 | 53 | #include 54 | 55 | namespace Assimp { 56 | namespace Profiling { 57 | 58 | using namespace Formatter; 59 | 60 | // ------------------------------------------------------------------------------------------------ 61 | /** Simple wrapper around boost::timer to simplify reporting. Timings are automatically 62 | * dumped to the log file. 63 | */ 64 | class Profiler { 65 | public: 66 | Profiler() { 67 | // empty 68 | } 69 | 70 | public: 71 | 72 | /** Start a named timer */ 73 | void BeginRegion(const std::string& region) { 74 | regions[region] = std::chrono::system_clock::now(); 75 | ASSIMP_LOG_DEBUG((format("START `"),region,"`")); 76 | } 77 | 78 | 79 | /** End a specific named timer and write its end time to the log */ 80 | void EndRegion(const std::string& region) { 81 | RegionMap::const_iterator it = regions.find(region); 82 | if (it == regions.end()) { 83 | return; 84 | } 85 | 86 | std::chrono::duration elapsedSeconds = std::chrono::system_clock::now() - regions[region]; 87 | ASSIMP_LOG_DEBUG((format("END `"),region,"`, dt= ", elapsedSeconds.count()," s")); 88 | } 89 | 90 | private: 91 | typedef std::map> RegionMap; 92 | RegionMap regions; 93 | }; 94 | 95 | } 96 | } 97 | 98 | #endif 99 | 100 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/ProgressHandler.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2019, assimp team 6 | 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use of this software in source and binary forms, 11 | with or without modification, are permitted provided that the 12 | following conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the 20 | following disclaimer in the documentation and/or other 21 | materials provided with the distribution. 22 | 23 | * Neither the name of the assimp team, nor the names of its 24 | contributors may be used to endorse or promote products 25 | derived from this software without specific prior 26 | written permission of the assimp team. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | 40 | ---------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file ProgressHandler.hpp 44 | * @brief Abstract base class 'ProgressHandler'. 45 | */ 46 | #pragma once 47 | #ifndef AI_PROGRESSHANDLER_H_INC 48 | #define AI_PROGRESSHANDLER_H_INC 49 | 50 | #include "types.h" 51 | 52 | namespace Assimp { 53 | 54 | // ------------------------------------------------------------------------------------ 55 | /** @brief CPP-API: Abstract interface for custom progress report receivers. 56 | * 57 | * Each #Importer instance maintains its own #ProgressHandler. The default 58 | * implementation provided by Assimp doesn't do anything at all. */ 59 | class ASSIMP_API ProgressHandler 60 | #ifndef SWIG 61 | : public Intern::AllocateFromAssimpHeap 62 | #endif 63 | { 64 | protected: 65 | /// @brief Default constructor 66 | ProgressHandler () AI_NO_EXCEPT { 67 | // empty 68 | } 69 | 70 | public: 71 | /// @brief Virtual destructor. 72 | virtual ~ProgressHandler () { 73 | } 74 | 75 | // ------------------------------------------------------------------- 76 | /** @brief Progress callback. 77 | * @param percentage An estimate of the current loading progress, 78 | * in percent. Or -1.f if such an estimate is not available. 79 | * 80 | * There are restriction on what you may do from within your 81 | * implementation of this method: no exceptions may be thrown and no 82 | * non-const #Importer methods may be called. It is 83 | * not generally possible to predict the number of callbacks 84 | * fired during a single import. 85 | * 86 | * @return Return false to abort loading at the next possible 87 | * occasion (loaders and Assimp are generally allowed to perform 88 | * all needed cleanup tasks prior to returning control to the 89 | * caller). If the loading is aborted, #Importer::ReadFile() 90 | * returns always NULL. 91 | * */ 92 | virtual bool Update(float percentage = -1.f) = 0; 93 | 94 | // ------------------------------------------------------------------- 95 | /** @brief Progress callback for file loading steps 96 | * @param numberOfSteps The number of total post-processing 97 | * steps 98 | * @param currentStep The index of the current post-processing 99 | * step that will run, or equal to numberOfSteps if all of 100 | * them has finished. This number is always strictly monotone 101 | * increasing, although not necessarily linearly. 102 | * 103 | * @note This is currently only used at the start and the end 104 | * of the file parsing. 105 | * */ 106 | virtual void UpdateFileRead(int currentStep /*= 0*/, int numberOfSteps /*= 0*/) { 107 | float f = numberOfSteps ? currentStep / (float)numberOfSteps : 1.0f; 108 | Update( f * 0.5f ); 109 | } 110 | 111 | // ------------------------------------------------------------------- 112 | /** @brief Progress callback for post-processing steps 113 | * @param numberOfSteps The number of total post-processing 114 | * steps 115 | * @param currentStep The index of the current post-processing 116 | * step that will run, or equal to numberOfSteps if all of 117 | * them has finished. This number is always strictly monotone 118 | * increasing, although not necessarily linearly. 119 | * */ 120 | virtual void UpdatePostProcess(int currentStep /*= 0*/, int numberOfSteps /*= 0*/) { 121 | float f = numberOfSteps ? currentStep / (float)numberOfSteps : 1.0f; 122 | Update( f * 0.5f + 0.5f ); 123 | } 124 | 125 | 126 | // ------------------------------------------------------------------- 127 | /** @brief Progress callback for export steps. 128 | * @param numberOfSteps The number of total processing 129 | * steps 130 | * @param currentStep The index of the current post-processing 131 | * step that will run, or equal to numberOfSteps if all of 132 | * them has finished. This number is always strictly monotone 133 | * increasing, although not necessarily linearly. 134 | * */ 135 | virtual void UpdateFileWrite(int currentStep /*= 0*/, int numberOfSteps /*= 0*/) { 136 | float f = numberOfSteps ? currentStep / (float)numberOfSteps : 1.0f; 137 | Update(f * 0.5f); 138 | } 139 | }; // !class ProgressHandler 140 | 141 | // ------------------------------------------------------------------------------------ 142 | 143 | } // Namespace Assimp 144 | 145 | #endif // AI_PROGRESSHANDLER_H_INC 146 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/RemoveComments.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2019, assimp team 6 | 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use of this software in source and binary forms, 11 | with or without modification, are permitted provided that the 12 | following conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the 20 | following disclaimer in the documentation and/or other 21 | materials provided with the distribution. 22 | 23 | * Neither the name of the assimp team, nor the names of its 24 | contributors may be used to endorse or promote products 25 | derived from this software without specific prior 26 | written permission of the assimp team. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | 40 | ---------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file Declares a helper class, "CommentRemover", which can be 44 | * used to remove comments (single and multi line) from a text file. 45 | */ 46 | #ifndef AI_REMOVE_COMMENTS_H_INC 47 | #define AI_REMOVE_COMMENTS_H_INC 48 | 49 | 50 | #include 51 | 52 | namespace Assimp { 53 | 54 | // --------------------------------------------------------------------------- 55 | /** \brief Helper class to remove single and multi line comments from a file 56 | * 57 | * Some mesh formats like MD5 have comments that are quite similar 58 | * to those in C or C++ so this code has been moved to a separate 59 | * module. 60 | */ 61 | class ASSIMP_API CommentRemover 62 | { 63 | // class cannot be instanced 64 | CommentRemover() {} 65 | 66 | public: 67 | 68 | //! Remove single-line comments. The end of a line is 69 | //! expected to be either NL or CR or NLCR. 70 | //! \param szComment The start sequence of the comment, e.g. "//" 71 | //! \param szBuffer Buffer to work with 72 | //! \param chReplacement Character to be used as replacement 73 | //! for commented lines. By default this is ' ' 74 | static void RemoveLineComments(const char* szComment, 75 | char* szBuffer, char chReplacement = ' '); 76 | 77 | //! Remove multi-line comments. The end of a line is 78 | //! expected to be either NL or CR or NLCR. Multi-line comments 79 | //! may not be nested (as in C). 80 | //! \param szCommentStart The start sequence of the comment, e.g. "/*" 81 | //! \param szCommentEnd The end sequence of the comment, e.g. "*/" 82 | //! \param szBuffer Buffer to work with 83 | //! \param chReplacement Character to be used as replacement 84 | //! for commented lines. By default this is ' ' 85 | static void RemoveMultiLineComments(const char* szCommentStart, 86 | const char* szCommentEnd,char* szBuffer, 87 | char chReplacement = ' '); 88 | }; 89 | } // ! Assimp 90 | 91 | #endif // !! AI_REMOVE_COMMENTS_H_INC 92 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/SGSpatialSort.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2019, assimp team 6 | 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use of this software in source and binary forms, 11 | with or without modification, are permitted provided that the 12 | following conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the 20 | following disclaimer in the documentation and/or other 21 | materials provided with the distribution. 22 | 23 | * Neither the name of the assimp team, nor the names of its 24 | contributors may be used to endorse or promote products 25 | derived from this software without specific prior 26 | written permission of the assimp team. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | 40 | ---------------------------------------------------------------------- 41 | */ 42 | 43 | /** Small helper classes to optimize finding vertices close to a given location 44 | */ 45 | #ifndef AI_D3DSSPATIALSORT_H_INC 46 | #define AI_D3DSSPATIALSORT_H_INC 47 | 48 | #include 49 | #include 50 | #include 51 | 52 | namespace Assimp { 53 | 54 | // ---------------------------------------------------------------------------------- 55 | /** Specialized version of SpatialSort to support smoothing groups 56 | * This is used in by the 3DS, ASE and LWO loaders. 3DS and ASE share their 57 | * normal computation code in SmoothingGroups.inl, the LWO loader has its own 58 | * implementation to handle all details of its file format correctly. 59 | */ 60 | // ---------------------------------------------------------------------------------- 61 | class ASSIMP_API SGSpatialSort 62 | { 63 | public: 64 | 65 | SGSpatialSort(); 66 | 67 | // ------------------------------------------------------------------- 68 | /** Construction from a given face array, handling smoothing groups 69 | * properly 70 | */ 71 | explicit SGSpatialSort(const std::vector& vPositions); 72 | 73 | // ------------------------------------------------------------------- 74 | /** Add a vertex to the spatial sort 75 | * @param vPosition Vertex position to be added 76 | * @param index Index of the vrtex 77 | * @param smoothingGroup SmoothingGroup for this vertex 78 | */ 79 | void Add(const aiVector3D& vPosition, unsigned int index, 80 | unsigned int smoothingGroup); 81 | 82 | // ------------------------------------------------------------------- 83 | /** Prepare the spatial sorter for use. This step runs in O(logn) 84 | */ 85 | void Prepare(); 86 | 87 | /** Destructor */ 88 | ~SGSpatialSort(); 89 | 90 | // ------------------------------------------------------------------- 91 | /** Returns an iterator for all positions close to the given position. 92 | * @param pPosition The position to look for vertices. 93 | * @param pSG Only included vertices with at least one shared smooth group 94 | * @param pRadius Maximal distance from the position a vertex may have 95 | * to be counted in. 96 | * @param poResults The container to store the indices of the found 97 | * positions. Will be emptied by the call so it may contain anything. 98 | * @param exactMatch Specifies whether smoothing groups are bit masks 99 | * (false) or integral values (true). In the latter case, a vertex 100 | * cannot belong to more than one smoothing group. 101 | * @return An iterator to iterate over all vertices in the given area. 102 | */ 103 | // ------------------------------------------------------------------- 104 | void FindPositions( const aiVector3D& pPosition, uint32_t pSG, 105 | float pRadius, std::vector& poResults, 106 | bool exactMatch = false) const; 107 | 108 | protected: 109 | /** Normal of the sorting plane, normalized. The center is always at (0, 0, 0) */ 110 | aiVector3D mPlaneNormal; 111 | 112 | // ------------------------------------------------------------------- 113 | /** An entry in a spatially sorted position array. Consists of a 114 | * vertex index, its position and its pre-calculated distance from 115 | * the reference plane */ 116 | // ------------------------------------------------------------------- 117 | struct Entry { 118 | unsigned int mIndex; ///< The vertex referred by this entry 119 | aiVector3D mPosition; ///< Position 120 | uint32_t mSmoothGroups; 121 | float mDistance; ///< Distance of this vertex to the sorting plane 122 | 123 | Entry() AI_NO_EXCEPT 124 | : mIndex(0) 125 | , mPosition() 126 | , mSmoothGroups(0) 127 | , mDistance(0.0f) { 128 | // empty 129 | } 130 | 131 | Entry( unsigned int pIndex, const aiVector3D& pPosition, float pDistance,uint32_t pSG) 132 | : mIndex( pIndex) 133 | , mPosition( pPosition) 134 | , mSmoothGroups(pSG) 135 | , mDistance( pDistance) { 136 | // empty 137 | } 138 | 139 | bool operator < (const Entry& e) const { 140 | return mDistance < e.mDistance; 141 | } 142 | }; 143 | 144 | // all positions, sorted by distance to the sorting plane 145 | std::vector mPositions; 146 | }; 147 | 148 | } // end of namespace Assimp 149 | 150 | #endif // AI_SPATIALSORT_H_INC 151 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/SkeletonMeshBuilder.h: -------------------------------------------------------------------------------- 1 | /** Helper class to construct a dummy mesh for file formats containing only motion data */ 2 | 3 | /* 4 | Open Asset Import Library (assimp) 5 | ---------------------------------------------------------------------- 6 | 7 | Copyright (c) 2006-2019, assimp team 8 | 9 | 10 | All rights reserved. 11 | 12 | Redistribution and use of this software in source and binary forms, 13 | with or without modification, are permitted provided that the 14 | following conditions are met: 15 | 16 | * Redistributions of source code must retain the above 17 | copyright notice, this list of conditions and the 18 | following disclaimer. 19 | 20 | * Redistributions in binary form must reproduce the above 21 | copyright notice, this list of conditions and the 22 | following disclaimer in the documentation and/or other 23 | materials provided with the distribution. 24 | 25 | * Neither the name of the assimp team, nor the names of its 26 | contributors may be used to endorse or promote products 27 | derived from this software without specific prior 28 | written permission of the assimp team. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | 42 | ---------------------------------------------------------------------- 43 | */ 44 | 45 | /** @file SkeletonMeshBuilder.h 46 | * Declares SkeletonMeshBuilder, a tiny utility to build dummy meshes 47 | * for animation skeletons. 48 | */ 49 | 50 | #ifndef AI_SKELETONMESHBUILDER_H_INC 51 | #define AI_SKELETONMESHBUILDER_H_INC 52 | 53 | #include 54 | #include 55 | 56 | struct aiMaterial; 57 | struct aiScene; 58 | struct aiNode; 59 | 60 | namespace Assimp { 61 | 62 | // --------------------------------------------------------------------------- 63 | /** 64 | * This little helper class constructs a dummy mesh for a given scene 65 | * the resembles the node hierarchy. This is useful for file formats 66 | * that don't carry any mesh data but only animation data. 67 | */ 68 | class ASSIMP_API SkeletonMeshBuilder 69 | { 70 | public: 71 | 72 | // ------------------------------------------------------------------- 73 | /** The constructor processes the given scene and adds a mesh there. 74 | * 75 | * Does nothing if the scene already has mesh data. 76 | * @param pScene The scene for which a skeleton mesh should be constructed. 77 | * @param root The node to start with. NULL is the scene root 78 | * @param bKnobsOnly Set this to true if you don't want the connectors 79 | * between the knobs representing the nodes. 80 | */ 81 | SkeletonMeshBuilder( aiScene* pScene, aiNode* root = NULL, 82 | bool bKnobsOnly = false); 83 | 84 | protected: 85 | 86 | // ------------------------------------------------------------------- 87 | /** Recursively builds a simple mesh representation for the given node 88 | * and also creates a joint for the node that affects this part of 89 | * the mesh. 90 | * @param pNode The node to build geometry for. 91 | */ 92 | void CreateGeometry( const aiNode* pNode); 93 | 94 | // ------------------------------------------------------------------- 95 | /** Creates the mesh from the internally accumulated stuff and returns it. 96 | */ 97 | aiMesh* CreateMesh(); 98 | 99 | // ------------------------------------------------------------------- 100 | /** Creates a dummy material and returns it. */ 101 | aiMaterial* CreateMaterial(); 102 | 103 | protected: 104 | /** space to assemble the mesh data: points */ 105 | std::vector mVertices; 106 | 107 | /** faces */ 108 | struct Face 109 | { 110 | unsigned int mIndices[3]; 111 | Face(); 112 | Face( unsigned int p0, unsigned int p1, unsigned int p2) 113 | { mIndices[0] = p0; mIndices[1] = p1; mIndices[2] = p2; } 114 | }; 115 | std::vector mFaces; 116 | 117 | /** bones */ 118 | std::vector mBones; 119 | 120 | bool mKnobsOnly; 121 | }; 122 | 123 | } // end of namespace Assimp 124 | 125 | #endif // AI_SKELETONMESHBUILDER_H_INC 126 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/SmoothingGroups.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2019, assimp team 6 | 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use of this software in source and binary forms, 11 | with or without modification, are permitted provided that the 12 | following conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the 20 | following disclaimer in the documentation and/or other 21 | materials provided with the distribution. 22 | 23 | * Neither the name of the assimp team, nor the names of its 24 | contributors may be used to endorse or promote products 25 | derived from this software without specific prior 26 | written permission of the assimp team. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | 40 | ---------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file Defines the helper data structures for importing 3DS files. 44 | http://www.jalix.org/ressources/graphics/3DS/_unofficials/3ds-unofficial.txt */ 45 | 46 | #ifndef AI_SMOOTHINGGROUPS_H_INC 47 | #define AI_SMOOTHINGGROUPS_H_INC 48 | 49 | #include 50 | #include 51 | #include 52 | 53 | // --------------------------------------------------------------------------- 54 | /** Helper structure representing a face with smoothing groups assigned */ 55 | struct FaceWithSmoothingGroup { 56 | FaceWithSmoothingGroup() AI_NO_EXCEPT 57 | : mIndices() 58 | , iSmoothGroup(0) { 59 | // in debug builds set all indices to a common magic value 60 | #ifdef ASSIMP_BUILD_DEBUG 61 | this->mIndices[0] = 0xffffffff; 62 | this->mIndices[1] = 0xffffffff; 63 | this->mIndices[2] = 0xffffffff; 64 | #endif 65 | } 66 | 67 | 68 | //! Indices. .3ds is using uint16. However, after 69 | //! an unique vertex set has been generated, 70 | //! individual index values might exceed 2^16 71 | uint32_t mIndices[3]; 72 | 73 | //! specifies to which smoothing group the face belongs to 74 | uint32_t iSmoothGroup; 75 | }; 76 | 77 | // --------------------------------------------------------------------------- 78 | /** Helper structure representing a mesh whose faces have smoothing 79 | groups assigned. This allows us to reuse the code for normal computations 80 | from smoothings groups for several loaders (3DS, ASE). All of them 81 | use face structures which inherit from #FaceWithSmoothingGroup, 82 | but as they add extra members and need to be copied by value we 83 | need to use a template here. 84 | */ 85 | template 86 | struct MeshWithSmoothingGroups 87 | { 88 | //! Vertex positions 89 | std::vector mPositions; 90 | 91 | //! Face lists 92 | std::vector mFaces; 93 | 94 | //! List of normal vectors 95 | std::vector mNormals; 96 | }; 97 | 98 | // --------------------------------------------------------------------------- 99 | /** Computes normal vectors for the mesh 100 | */ 101 | template 102 | void ComputeNormalsWithSmoothingsGroups(MeshWithSmoothingGroups& sMesh); 103 | 104 | 105 | // include implementations 106 | #include "SmoothingGroups.inl" 107 | 108 | #endif // !! AI_SMOOTHINGGROUPS_H_INC 109 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/SmoothingGroups.inl: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2012, assimp team 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use of this software in source and binary forms, 11 | with or without modification, are permitted provided that the following 12 | conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the 20 | following disclaimer in the documentation and/or other 21 | materials provided with the distribution. 22 | 23 | * Neither the name of the assimp team, nor the names of its 24 | contributors may be used to endorse or promote products 25 | derived from this software without specific prior 26 | written permission of the assimp team. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | --------------------------------------------------------------------------- 40 | */ 41 | 42 | /** @file Generation of normal vectors basing on smoothing groups */ 43 | 44 | #ifndef AI_SMOOTHINGGROUPS_INL_INCLUDED 45 | #define AI_SMOOTHINGGROUPS_INL_INCLUDED 46 | 47 | // internal headers 48 | #include 49 | 50 | // CRT header 51 | #include 52 | 53 | using namespace Assimp; 54 | 55 | // ------------------------------------------------------------------------------------------------ 56 | template 57 | void ComputeNormalsWithSmoothingsGroups(MeshWithSmoothingGroups& sMesh) 58 | { 59 | // First generate face normals 60 | sMesh.mNormals.resize(sMesh.mPositions.size(),aiVector3D()); 61 | for( unsigned int a = 0; a < sMesh.mFaces.size(); a++) 62 | { 63 | T& face = sMesh.mFaces[a]; 64 | 65 | aiVector3D* pV1 = &sMesh.mPositions[face.mIndices[0]]; 66 | aiVector3D* pV2 = &sMesh.mPositions[face.mIndices[1]]; 67 | aiVector3D* pV3 = &sMesh.mPositions[face.mIndices[2]]; 68 | 69 | aiVector3D pDelta1 = *pV2 - *pV1; 70 | aiVector3D pDelta2 = *pV3 - *pV1; 71 | aiVector3D vNor = pDelta1 ^ pDelta2; 72 | 73 | for (unsigned int c = 0; c < 3;++c) 74 | sMesh.mNormals[face.mIndices[c]] = vNor; 75 | } 76 | 77 | // calculate the position bounds so we have a reliable epsilon to check position differences against 78 | aiVector3D minVec( 1e10f, 1e10f, 1e10f), maxVec( -1e10f, -1e10f, -1e10f); 79 | for( unsigned int a = 0; a < sMesh.mPositions.size(); a++) 80 | { 81 | minVec.x = std::min( minVec.x, sMesh.mPositions[a].x); 82 | minVec.y = std::min( minVec.y, sMesh.mPositions[a].y); 83 | minVec.z = std::min( minVec.z, sMesh.mPositions[a].z); 84 | maxVec.x = std::max( maxVec.x, sMesh.mPositions[a].x); 85 | maxVec.y = std::max( maxVec.y, sMesh.mPositions[a].y); 86 | maxVec.z = std::max( maxVec.z, sMesh.mPositions[a].z); 87 | } 88 | const float posEpsilon = (maxVec - minVec).Length() * 1e-5f; 89 | std::vector avNormals; 90 | avNormals.resize(sMesh.mNormals.size()); 91 | 92 | // now generate the spatial sort tree 93 | SGSpatialSort sSort; 94 | for( typename std::vector::iterator i = sMesh.mFaces.begin(); 95 | i != sMesh.mFaces.end();++i) 96 | { 97 | for (unsigned int c = 0; c < 3;++c) 98 | sSort.Add(sMesh.mPositions[(*i).mIndices[c]],(*i).mIndices[c],(*i).iSmoothGroup); 99 | } 100 | sSort.Prepare(); 101 | 102 | std::vector vertexDone(sMesh.mPositions.size(),false); 103 | for( typename std::vector::iterator i = sMesh.mFaces.begin(); 104 | i != sMesh.mFaces.end();++i) 105 | { 106 | std::vector poResult; 107 | for (unsigned int c = 0; c < 3;++c) 108 | { 109 | unsigned int idx = (*i).mIndices[c]; 110 | if (vertexDone[idx])continue; 111 | 112 | sSort.FindPositions(sMesh.mPositions[idx],(*i).iSmoothGroup, 113 | posEpsilon,poResult); 114 | 115 | aiVector3D vNormals; 116 | for (std::vector::const_iterator 117 | a = poResult.begin(); 118 | a != poResult.end();++a) 119 | { 120 | vNormals += sMesh.mNormals[(*a)]; 121 | } 122 | vNormals.NormalizeSafe(); 123 | 124 | // write back into all affected normals 125 | for (std::vector::const_iterator 126 | a = poResult.begin(); 127 | a != poResult.end();++a) 128 | { 129 | idx = *a; 130 | avNormals [idx] = vNormals; 131 | vertexDone[idx] = true; 132 | } 133 | } 134 | } 135 | sMesh.mNormals = avNormals; 136 | } 137 | 138 | #endif // !! AI_SMOOTHINGGROUPS_INL_INCLUDED 139 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/StandardShapes.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2019, assimp team 6 | 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use of this software in source and binary forms, 11 | with or without modification, are permitted provided that the 12 | following conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the 20 | following disclaimer in the documentation and/or other 21 | materials provided with the distribution. 22 | 23 | * Neither the name of the assimp team, nor the names of its 24 | contributors may be used to endorse or promote products 25 | derived from this software without specific prior 26 | written permission of the assimp team. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | 40 | ---------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file Declares a helper class, "StandardShapes" which generates 44 | * vertices for standard shapes, such as cylnders, cones, spheres .. 45 | */ 46 | #ifndef AI_STANDARD_SHAPES_H_INC 47 | #define AI_STANDARD_SHAPES_H_INC 48 | 49 | #include 50 | #include 51 | 52 | struct aiMesh; 53 | 54 | namespace Assimp { 55 | 56 | // --------------------------------------------------------------------------- 57 | /** \brief Helper class to generate vertex buffers for standard geometric 58 | * shapes, such as cylinders, cones, boxes, spheres, elipsoids ... . 59 | */ 60 | class ASSIMP_API StandardShapes 61 | { 62 | // class cannot be instanced 63 | StandardShapes() {} 64 | 65 | public: 66 | 67 | 68 | // ---------------------------------------------------------------- 69 | /** Generates a mesh from an array of vertex positions. 70 | * 71 | * @param positions List of vertex positions 72 | * @param numIndices Number of indices per primitive 73 | * @return Output mesh 74 | */ 75 | static aiMesh* MakeMesh(const std::vector& positions, 76 | unsigned int numIndices); 77 | 78 | 79 | static aiMesh* MakeMesh ( unsigned int (*GenerateFunc) 80 | (std::vector&)); 81 | 82 | static aiMesh* MakeMesh ( unsigned int (*GenerateFunc) 83 | (std::vector&, bool)); 84 | 85 | static aiMesh* MakeMesh ( unsigned int n, void (*GenerateFunc) 86 | (unsigned int,std::vector&)); 87 | 88 | // ---------------------------------------------------------------- 89 | /** @brief Generates a hexahedron (cube) 90 | * 91 | * Hexahedrons can be scaled on all axes. 92 | * @param positions Receives output triangles. 93 | * @param polygons If you pass true here quads will be returned 94 | * @return Number of vertices per face 95 | */ 96 | static unsigned int MakeHexahedron( 97 | std::vector& positions, 98 | bool polygons = false); 99 | 100 | // ---------------------------------------------------------------- 101 | /** @brief Generates an icosahedron 102 | * 103 | * @param positions Receives output triangles. 104 | * @return Number of vertices per face 105 | */ 106 | static unsigned int MakeIcosahedron( 107 | std::vector& positions); 108 | 109 | 110 | // ---------------------------------------------------------------- 111 | /** @brief Generates a dodecahedron 112 | * 113 | * @param positions Receives output triangles 114 | * @param polygons If you pass true here pentagons will be returned 115 | * @return Number of vertices per face 116 | */ 117 | static unsigned int MakeDodecahedron( 118 | std::vector& positions, 119 | bool polygons = false); 120 | 121 | 122 | // ---------------------------------------------------------------- 123 | /** @brief Generates an octahedron 124 | * 125 | * @param positions Receives output triangles. 126 | * @return Number of vertices per face 127 | */ 128 | static unsigned int MakeOctahedron( 129 | std::vector& positions); 130 | 131 | 132 | // ---------------------------------------------------------------- 133 | /** @brief Generates a tetrahedron 134 | * 135 | * @param positions Receives output triangles. 136 | * @return Number of vertices per face 137 | */ 138 | static unsigned int MakeTetrahedron( 139 | std::vector& positions); 140 | 141 | 142 | 143 | // ---------------------------------------------------------------- 144 | /** @brief Generates a sphere 145 | * 146 | * @param tess Number of subdivions - 0 generates a octahedron 147 | * @param positions Receives output triangles. 148 | */ 149 | static void MakeSphere(unsigned int tess, 150 | std::vector& positions); 151 | 152 | 153 | // ---------------------------------------------------------------- 154 | /** @brief Generates a cone or a cylinder, either open or closed. 155 | * 156 | * @code 157 | * 158 | * |-----| <- radius 1 159 | * 160 | * __x__ <- ] ^ 161 | * / \ | height | 162 | * / \ | Y 163 | * / \ | 164 | * / \ | 165 | * /______x______\ <- ] <- end cap 166 | * 167 | * |-------------| <- radius 2 168 | * 169 | * @endcode 170 | * 171 | * @param height Height of the cone 172 | * @param radius1 First radius 173 | * @param radius2 Second radius 174 | * @param tess Number of triangles. 175 | * @param bOpened true for an open cone/cylinder. An open shape has 176 | * no 'end caps' 177 | * @param positions Receives output triangles 178 | */ 179 | static void MakeCone(ai_real height,ai_real radius1, 180 | ai_real radius2,unsigned int tess, 181 | std::vector& positions,bool bOpen= false); 182 | 183 | 184 | // ---------------------------------------------------------------- 185 | /** @brief Generates a flat circle 186 | * 187 | * The circle is constructed in the planned formed by the x,z 188 | * axes of the cartesian coordinate system. 189 | * 190 | * @param radius Radius of the circle 191 | * @param tess Number of segments. 192 | * @param positions Receives output triangles. 193 | */ 194 | static void MakeCircle(ai_real radius, unsigned int tess, 195 | std::vector& positions); 196 | 197 | }; 198 | } // ! Assimp 199 | 200 | #endif // !! AI_STANDARD_SHAPES_H_INC 201 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/StringUtils.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2019, assimp team 6 | 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use of this software in source and binary forms, 11 | with or without modification, are permitted provided that the 12 | following conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the 20 | following disclaimer in the documentation and/or other 21 | materials provided with the distribution. 22 | 23 | * Neither the name of the assimp team, nor the names of its 24 | contributors may be used to endorse or promote products 25 | derived from this software without specific prior 26 | written permission of the assimp team. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | 40 | ---------------------------------------------------------------------- 41 | */ 42 | #ifndef INCLUDED_AI_STRINGUTILS_H 43 | #define INCLUDED_AI_STRINGUTILS_H 44 | 45 | #include 46 | 47 | #include 48 | #include 49 | #include 50 | 51 | /// @fn ai_snprintf 52 | /// @brief The portable version of the function snprintf ( C99 standard ), which works on visual studio compilers 2013 and earlier. 53 | /// @param outBuf The buffer to write in 54 | /// @param size The buffer size 55 | /// @param format The format string 56 | /// @param ap The additional arguments. 57 | /// @return The number of written characters if the buffer size was big enough. If an encoding error occurs, a negative number is returned. 58 | #if defined(_MSC_VER) && _MSC_VER < 1900 59 | 60 | AI_FORCE_INLINE 61 | int c99_ai_vsnprintf(char *outBuf, size_t size, const char *format, va_list ap) { 62 | int count(-1); 63 | if (0 != size) { 64 | count = _vsnprintf_s(outBuf, size, _TRUNCATE, format, ap); 65 | } 66 | if (count == -1) { 67 | count = _vscprintf(format, ap); 68 | } 69 | 70 | return count; 71 | } 72 | 73 | AI_FORCE_INLINE 74 | int ai_snprintf(char *outBuf, size_t size, const char *format, ...) { 75 | int count; 76 | va_list ap; 77 | 78 | va_start(ap, format); 79 | count = c99_ai_vsnprintf(outBuf, size, format, ap); 80 | va_end(ap); 81 | 82 | return count; 83 | } 84 | 85 | #else 86 | # define ai_snprintf snprintf 87 | #endif 88 | 89 | /// @fn to_string 90 | /// @brief The portable version of to_string ( some gcc-versions on embedded devices are not supporting this). 91 | /// @param value The value to write into the std::string. 92 | /// @return The value as a std::string 93 | template 94 | AI_FORCE_INLINE 95 | std::string to_string( T value ) { 96 | std::ostringstream os; 97 | os << value; 98 | 99 | return os.str(); 100 | } 101 | 102 | /// @fn ai_strtof 103 | /// @brief The portable version of strtof. 104 | /// @param begin The first character of the string. 105 | /// @param end The last character 106 | /// @return The float value, 0.0f in cas of an error. 107 | AI_FORCE_INLINE 108 | float ai_strtof( const char *begin, const char *end ) { 109 | if ( nullptr == begin ) { 110 | return 0.0f; 111 | } 112 | float val( 0.0f ); 113 | if ( nullptr == end ) { 114 | val = static_cast< float >( ::atof( begin ) ); 115 | } else { 116 | std::string::size_type len( end - begin ); 117 | std::string token( begin, len ); 118 | val = static_cast< float >( ::atof( token.c_str() ) ); 119 | } 120 | 121 | return val; 122 | } 123 | 124 | /// @fn DecimalToHexa 125 | /// @brief The portable to convert a decimal value into a hexadecimal string. 126 | /// @param toConvert Value to convert 127 | /// @return The hexadecimal string, is empty in case of an error. 128 | template 129 | AI_FORCE_INLINE 130 | std::string DecimalToHexa( T toConvert ) { 131 | std::string result; 132 | std::stringstream ss; 133 | ss << std::hex << toConvert; 134 | ss >> result; 135 | 136 | for ( size_t i = 0; i < result.size(); ++i ) { 137 | result[ i ] = toupper( result[ i ] ); 138 | } 139 | 140 | return result; 141 | } 142 | 143 | #endif // INCLUDED_AI_STRINGUTILS_H 144 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/Subdivision.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2019, assimp team 6 | 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use of this software in source and binary forms, 11 | with or without modification, are permitted provided that the 12 | following conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the 20 | following disclaimer in the documentation and/or other 21 | materials provided with the distribution. 22 | 23 | * Neither the name of the assimp team, nor the names of its 24 | contributors may be used to endorse or promote products 25 | derived from this software without specific prior 26 | written permission of the assimp team. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | 40 | ---------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file Defines a helper class to evaluate subdivision surfaces.*/ 44 | #pragma once 45 | #ifndef AI_SUBDISIVION_H_INC 46 | #define AI_SUBDISIVION_H_INC 47 | 48 | #include 49 | #include 50 | 51 | struct aiMesh; 52 | 53 | namespace Assimp { 54 | 55 | // ------------------------------------------------------------------------------ 56 | /** Helper class to evaluate subdivision surfaces. Different algorithms 57 | * are provided for choice. */ 58 | // ------------------------------------------------------------------------------ 59 | class ASSIMP_API Subdivider { 60 | public: 61 | 62 | /** Enumerates all supported subvidision algorithms */ 63 | enum Algorithm { 64 | CATMULL_CLARKE = 0x1 65 | }; 66 | 67 | virtual ~Subdivider(); 68 | 69 | // --------------------------------------------------------------- 70 | /** Create a subdivider of a specific type 71 | * 72 | * @param algo Algorithm to be used for subdivision 73 | * @return Subdivider instance. */ 74 | static Subdivider* Create (Algorithm algo); 75 | 76 | // --------------------------------------------------------------- 77 | /** Subdivide a mesh using the selected algorithm 78 | * 79 | * @param mesh First mesh to be subdivided. Must be in verbose 80 | * format. 81 | * @param out Receives the output mesh, allocated by me. 82 | * @param num Number of subdivisions to perform. 83 | * @param discard_input If true is passed, the input mesh is 84 | * deleted after the subdivision is complete. This can 85 | * improve performance because it allows the optimization 86 | * to reuse the existing mesh for intermediate results. 87 | * @pre out!=mesh*/ 88 | virtual void Subdivide ( aiMesh* mesh, 89 | aiMesh*& out, unsigned int num, 90 | bool discard_input = false) = 0; 91 | 92 | // --------------------------------------------------------------- 93 | /** Subdivide multiple meshes using the selected algorithm. This 94 | * avoids erroneous smoothing on objects consisting of multiple 95 | * per-material meshes. Usually, most 3d modellers smooth on a 96 | * per-object base, regardless the materials assigned to the 97 | * meshes. 98 | * 99 | * @param smesh Array of meshes to be subdivided. Must be in 100 | * verbose format. 101 | * @param nmesh Number of meshes in smesh. 102 | * @param out Receives the output meshes. The array must be 103 | * sufficiently large (at least @c nmesh elements) and may not 104 | * overlap the input array. Output meshes map one-to-one to 105 | * their corresponding input meshes. The meshes are allocated 106 | * by the function. 107 | * @param discard_input If true is passed, input meshes are 108 | * deleted after the subdivision is complete. This can 109 | * improve performance because it allows the optimization 110 | * of reusing existing meshes for intermediate results. 111 | * @param num Number of subdivisions to perform. 112 | * @pre nmesh != 0, smesh and out may not overlap*/ 113 | virtual void Subdivide ( 114 | aiMesh** smesh, 115 | size_t nmesh, 116 | aiMesh** out, 117 | unsigned int num, 118 | bool discard_input = false) = 0; 119 | 120 | }; 121 | 122 | inline 123 | Subdivider::~Subdivider() { 124 | // empty 125 | } 126 | 127 | } // end namespace Assimp 128 | 129 | 130 | #endif // !! AI_SUBDISIVION_H_INC 131 | 132 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/TinyFormatter.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2019, assimp team 6 | 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use of this software in source and binary forms, 11 | with or without modification, are permitted provided that the 12 | following conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the 20 | following disclaimer in the documentation and/or other 21 | materials provided with the distribution. 22 | 23 | * Neither the name of the assimp team, nor the names of its 24 | contributors may be used to endorse or promote products 25 | derived from this software without specific prior 26 | written permission of the assimp team. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | 40 | ---------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file TinyFormatter.h 44 | * @brief Utility to format log messages more easily. Introduced 45 | * to get rid of the boost::format dependency. Much slinker, 46 | * basically just extends stringstream. 47 | */ 48 | #ifndef INCLUDED_TINY_FORMATTER_H 49 | #define INCLUDED_TINY_FORMATTER_H 50 | 51 | #include 52 | 53 | namespace Assimp { 54 | namespace Formatter { 55 | 56 | // ------------------------------------------------------------------------------------------------ 57 | /** stringstream utility. Usage: 58 | * @code 59 | * void writelog(const std::string&s); 60 | * void writelog(const std::wstring&s); 61 | * ... 62 | * writelog(format()<< "hi! this is a number: " << 4); 63 | * writelog(wformat()<< L"hi! this is a number: " << 4); 64 | * 65 | * @endcode */ 66 | template < typename T, 67 | typename CharTraits = std::char_traits, 68 | typename Allocator = std::allocator 69 | > 70 | class basic_formatter 71 | { 72 | 73 | public: 74 | 75 | typedef class std::basic_string< 76 | T,CharTraits,Allocator 77 | > string; 78 | 79 | typedef class std::basic_ostringstream< 80 | T,CharTraits,Allocator 81 | > stringstream; 82 | 83 | public: 84 | 85 | basic_formatter() {} 86 | 87 | /* Allow basic_formatter's to be used almost interchangeably 88 | * with std::(w)string or const (w)char* arguments because the 89 | * conversion c'tor is called implicitly. */ 90 | template 91 | basic_formatter(const TT& sin) { 92 | underlying << sin; 93 | } 94 | 95 | 96 | // The problem described here: 97 | // https://sourceforge.net/tracker/?func=detail&atid=1067632&aid=3358562&group_id=226462 98 | // can also cause trouble here. Apparently, older gcc versions sometimes copy temporaries 99 | // being bound to const ref& function parameters. Copying streams is not permitted, though. 100 | // This workaround avoids this by manually specifying a copy ctor. 101 | #if !defined(__GNUC__) || !defined(__APPLE__) || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) 102 | explicit basic_formatter(const basic_formatter& other) { 103 | underlying << (string)other; 104 | } 105 | #endif 106 | 107 | 108 | public: 109 | 110 | operator string () const { 111 | return underlying.str(); 112 | } 113 | 114 | 115 | /* note - this is declared const because binding temporaries does only 116 | * work for const references, so many function prototypes will 117 | * include const basic_formatter& s but might still want to 118 | * modify the formatted string without the need for a full copy.*/ 119 | template 120 | const basic_formatter& operator << (const TToken& s) const { 121 | underlying << s; 122 | return *this; 123 | } 124 | 125 | template 126 | basic_formatter& operator << (const TToken& s) { 127 | underlying << s; 128 | return *this; 129 | } 130 | 131 | 132 | // comma operator overloaded as well, choose your preferred way. 133 | template 134 | const basic_formatter& operator, (const TToken& s) const { 135 | underlying << s; 136 | return *this; 137 | } 138 | 139 | template 140 | basic_formatter& operator, (const TToken& s) { 141 | underlying << s; 142 | return *this; 143 | } 144 | 145 | // Fix for MSVC8 146 | // See https://sourceforge.net/projects/assimp/forums/forum/817654/topic/4372824 147 | template 148 | basic_formatter& operator, (TToken& s) { 149 | underlying << s; 150 | return *this; 151 | } 152 | 153 | 154 | private: 155 | mutable stringstream underlying; 156 | }; 157 | 158 | 159 | typedef basic_formatter< char > format; 160 | typedef basic_formatter< wchar_t > wformat; 161 | 162 | } // ! namespace Formatter 163 | 164 | } // ! namespace Assimp 165 | 166 | #endif 167 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/XMLTools.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2019, assimp team 6 | 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use of this software in source and binary forms, 11 | with or without modification, are permitted provided that the 12 | following conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the 20 | following disclaimer in the documentation and/or other 21 | materials provided with the distribution. 22 | 23 | * Neither the name of the assimp team, nor the names of its 24 | contributors may be used to endorse or promote products 25 | derived from this software without specific prior 26 | written permission of the assimp team. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | 40 | ---------------------------------------------------------------------- 41 | */ 42 | 43 | #ifndef INCLUDED_ASSIMP_XML_TOOLS_H 44 | #define INCLUDED_ASSIMP_XML_TOOLS_H 45 | 46 | #include 47 | 48 | namespace Assimp { 49 | // XML escape the 5 XML special characters (",',<,> and &) in |data| 50 | // Based on http://stackoverflow.com/questions/5665231 51 | std::string XMLEscape(const std::string& data) { 52 | std::string buffer; 53 | 54 | const size_t size = data.size(); 55 | buffer.reserve(size + size / 8); 56 | for(size_t i = 0; i < size; ++i) { 57 | const char c = data[i]; 58 | switch(c) { 59 | case '&' : 60 | buffer.append("&"); 61 | break; 62 | case '\"': 63 | buffer.append("""); 64 | break; 65 | case '\'': 66 | buffer.append("'"); 67 | break; 68 | case '<' : 69 | buffer.append("<"); 70 | break; 71 | case '>' : 72 | buffer.append(">"); 73 | break; 74 | default: 75 | buffer.append(&c, 1); 76 | break; 77 | } 78 | } 79 | return buffer; 80 | } 81 | } 82 | 83 | #endif // INCLUDED_ASSIMP_XML_TOOLS_H 84 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/ZipArchiveIOSystem.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2019, assimp team 7 | 8 | 9 | 10 | All rights reserved. 11 | 12 | Redistribution and use of this software in source and binary forms, 13 | with or without modification, are permitted provided that the following 14 | conditions are met: 15 | 16 | * Redistributions of source code must retain the above 17 | copyright notice, this list of conditions and the 18 | following disclaimer. 19 | 20 | * Redistributions in binary form must reproduce the above 21 | copyright notice, this list of conditions and the 22 | following disclaimer in the documentation and/or other 23 | materials provided with the distribution. 24 | 25 | * Neither the name of the assimp team, nor the names of its 26 | contributors may be used to endorse or promote products 27 | derived from this software without specific prior 28 | written permission of the assimp team. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | --------------------------------------------------------------------------- 42 | */ 43 | 44 | /** @file ZipArchiveIOSystem.h 45 | * @brief Implementation of IOSystem to read a ZIP file from another IOSystem 46 | */ 47 | 48 | #ifndef AI_ZIPARCHIVEIOSYSTEM_H_INC 49 | #define AI_ZIPARCHIVEIOSYSTEM_H_INC 50 | 51 | #include 52 | #include 53 | 54 | namespace Assimp { 55 | class ZipArchiveIOSystem : public IOSystem { 56 | public: 57 | //! Open a Zip using the proffered IOSystem 58 | ZipArchiveIOSystem(IOSystem* pIOHandler, const char *pFilename, const char* pMode = "r"); 59 | ZipArchiveIOSystem(IOSystem* pIOHandler, const std::string& rFilename, const char* pMode = "r"); 60 | virtual ~ZipArchiveIOSystem(); 61 | bool Exists(const char* pFilename) const override; 62 | char getOsSeparator() const override; 63 | IOStream* Open(const char* pFilename, const char* pMode = "rb") override; 64 | void Close(IOStream* pFile) override; 65 | 66 | // Specific to ZIP 67 | //! The file was opened and is a ZIP 68 | bool isOpen() const; 69 | 70 | //! Get the list of all files with their simplified paths 71 | //! Intended for use within Assimp library boundaries 72 | void getFileList(std::vector& rFileList) const; 73 | 74 | //! Get the list of all files with extension (must be lowercase) 75 | //! Intended for use within Assimp library boundaries 76 | void getFileListExtension(std::vector& rFileList, const std::string& extension) const; 77 | 78 | static bool isZipArchive(IOSystem* pIOHandler, const char *pFilename); 79 | static bool isZipArchive(IOSystem* pIOHandler, const std::string& rFilename); 80 | 81 | private: 82 | class Implement; 83 | Implement *pImpl = nullptr; 84 | }; 85 | } // Namespace Assimp 86 | 87 | #endif // AI_ZIPARCHIVEIOSYSTEM_H_INC 88 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/aabb.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2019, assimp team 7 | 8 | 9 | 10 | All rights reserved. 11 | 12 | Redistribution and use of this software in source and binary forms, 13 | with or without modification, are permitted provided that the following 14 | conditions are met: 15 | 16 | * Redistributions of source code must retain the above 17 | copyright notice, this list of conditions and the 18 | following disclaimer. 19 | 20 | * Redistributions in binary form must reproduce the above 21 | copyright notice, this list of conditions and the 22 | following disclaimer in the documentation and/or other 23 | materials provided with the distribution. 24 | 25 | * Neither the name of the assimp team, nor the names of its 26 | contributors may be used to endorse or promote products 27 | derived from this software without specific prior 28 | written permission of the assimp team. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | --------------------------------------------------------------------------- 42 | */ 43 | 44 | #pragma once 45 | #ifndef AI_AABB_H_INC 46 | #define AI_AABB_H_INC 47 | 48 | #include 49 | 50 | struct aiAABB { 51 | C_STRUCT aiVector3D mMin; 52 | C_STRUCT aiVector3D mMax; 53 | 54 | #ifdef __cplusplus 55 | 56 | aiAABB() 57 | : mMin() 58 | , mMax() { 59 | // empty 60 | } 61 | 62 | aiAABB(const aiVector3D &min, const aiVector3D &max ) 63 | : mMin(min) 64 | , mMax(max) { 65 | // empty 66 | } 67 | 68 | ~aiAABB() { 69 | // empty 70 | } 71 | 72 | #endif 73 | }; 74 | 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/ai_assert.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2019, assimp team 7 | 8 | 9 | 10 | All rights reserved. 11 | 12 | Redistribution and use of this software in source and binary forms, 13 | with or without modification, are permitted provided that the following 14 | conditions are met: 15 | 16 | * Redistributions of source code must retain the above 17 | copyright notice, this list of conditions and the 18 | following disclaimer. 19 | 20 | * Redistributions in binary form must reproduce the above 21 | copyright notice, this list of conditions and the 22 | following disclaimer in the documentation and/or other 23 | materials provided with the distribution. 24 | 25 | * Neither the name of the assimp team, nor the names of its 26 | contributors may be used to endorse or promote products 27 | derived from this software without specific prior 28 | written permission of the assimp team. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | --------------------------------------------------------------------------- 42 | */ 43 | #pragma once 44 | #ifndef AI_ASSERT_H_INC 45 | #define AI_ASSERT_H_INC 46 | 47 | #ifdef ASSIMP_BUILD_DEBUG 48 | # include 49 | # define ai_assert(expression) assert( expression ) 50 | # define ai_assert_entry() assert( false ) 51 | #else 52 | # define ai_assert(expression) 53 | # define ai_assert_entry() 54 | #endif // ASSIMP_BUILD_DEBUG 55 | 56 | #endif // AI_ASSERT_H_INC 57 | 58 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/cfileio.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2019, assimp team 7 | 8 | 9 | 10 | All rights reserved. 11 | 12 | Redistribution and use of this software in source and binary forms, 13 | with or without modification, are permitted provided that the following 14 | conditions are met: 15 | 16 | * Redistributions of source code must retain the above 17 | copyright notice, this list of conditions and the 18 | following disclaimer. 19 | 20 | * Redistributions in binary form must reproduce the above 21 | copyright notice, this list of conditions and the 22 | following disclaimer in the documentation and/or other 23 | materials provided with the distribution. 24 | 25 | * Neither the name of the assimp team, nor the names of its 26 | contributors may be used to endorse or promote products 27 | derived from this software without specific prior 28 | written permission of the assimp team. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | --------------------------------------------------------------------------- 42 | */ 43 | 44 | /** @file cfileio.h 45 | * @brief Defines generic C routines to access memory-mapped files 46 | */ 47 | #pragma once 48 | #ifndef AI_FILEIO_H_INC 49 | #define AI_FILEIO_H_INC 50 | 51 | #include 52 | #ifdef __cplusplus 53 | extern "C" { 54 | #endif 55 | struct aiFileIO; 56 | struct aiFile; 57 | 58 | // aiFile callbacks 59 | typedef size_t (*aiFileWriteProc) (C_STRUCT aiFile*, const char*, size_t, size_t); 60 | typedef size_t (*aiFileReadProc) (C_STRUCT aiFile*, char*, size_t,size_t); 61 | typedef size_t (*aiFileTellProc) (C_STRUCT aiFile*); 62 | typedef void (*aiFileFlushProc) (C_STRUCT aiFile*); 63 | typedef C_ENUM aiReturn (*aiFileSeek) (C_STRUCT aiFile*, size_t, C_ENUM aiOrigin); 64 | 65 | // aiFileIO callbacks 66 | typedef C_STRUCT aiFile* (*aiFileOpenProc) (C_STRUCT aiFileIO*, const char*, const char*); 67 | typedef void (*aiFileCloseProc) (C_STRUCT aiFileIO*, C_STRUCT aiFile*); 68 | 69 | // Represents user-defined data 70 | typedef char* aiUserData; 71 | 72 | // ---------------------------------------------------------------------------------- 73 | /** @brief C-API: File system callbacks 74 | * 75 | * Provided are functions to open and close files. Supply a custom structure to 76 | * the import function. If you don't, a default implementation is used. Use custom 77 | * file systems to enable reading from other sources, such as ZIPs 78 | * or memory locations. */ 79 | struct aiFileIO 80 | { 81 | /** Function used to open a new file 82 | */ 83 | aiFileOpenProc OpenProc; 84 | 85 | /** Function used to close an existing file 86 | */ 87 | aiFileCloseProc CloseProc; 88 | 89 | /** User-defined, opaque data */ 90 | aiUserData UserData; 91 | }; 92 | 93 | // ---------------------------------------------------------------------------------- 94 | /** @brief C-API: File callbacks 95 | * 96 | * Actually, it's a data structure to wrap a set of fXXXX (e.g fopen) 97 | * replacement functions. 98 | * 99 | * The default implementation of the functions utilizes the fXXX functions from 100 | * the CRT. However, you can supply a custom implementation to Assimp by 101 | * delivering a custom aiFileIO. Use this to enable reading from other sources, 102 | * such as ZIP archives or memory locations. */ 103 | struct aiFile 104 | { 105 | /** Callback to read from a file */ 106 | aiFileReadProc ReadProc; 107 | 108 | /** Callback to write to a file */ 109 | aiFileWriteProc WriteProc; 110 | 111 | /** Callback to retrieve the current position of 112 | * the file cursor (ftell()) 113 | */ 114 | aiFileTellProc TellProc; 115 | 116 | /** Callback to retrieve the size of the file, 117 | * in bytes 118 | */ 119 | aiFileTellProc FileSizeProc; 120 | 121 | /** Callback to set the current position 122 | * of the file cursor (fseek()) 123 | */ 124 | aiFileSeek SeekProc; 125 | 126 | /** Callback to flush the file contents 127 | */ 128 | aiFileFlushProc FlushProc; 129 | 130 | /** User-defined, opaque data 131 | */ 132 | aiUserData UserData; 133 | }; 134 | 135 | #ifdef __cplusplus 136 | } 137 | #endif 138 | #endif // AI_FILEIO_H_INC 139 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/color4.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2019, assimp team 7 | 8 | 9 | 10 | All rights reserved. 11 | 12 | Redistribution and use of this software in source and binary forms, 13 | with or without modification, are permitted provided that the following 14 | conditions are met: 15 | 16 | * Redistributions of source code must retain the above 17 | copyright notice, this list of conditions and the 18 | following disclaimer. 19 | 20 | * Redistributions in binary form must reproduce the above 21 | copyright notice, this list of conditions and the 22 | following disclaimer in the documentation and/or other 23 | materials provided with the distribution. 24 | 25 | * Neither the name of the assimp team, nor the names of its 26 | contributors may be used to endorse or promote products 27 | derived from this software without specific prior 28 | written permission of the assimp team. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | --------------------------------------------------------------------------- 42 | */ 43 | /** @file color4.h 44 | * @brief RGBA color structure, including operators when compiling in C++ 45 | */ 46 | #pragma once 47 | #ifndef AI_COLOR4D_H_INC 48 | #define AI_COLOR4D_H_INC 49 | 50 | #include "defs.h" 51 | 52 | #ifdef __cplusplus 53 | 54 | // ---------------------------------------------------------------------------------- 55 | /** Represents a color in Red-Green-Blue space including an 56 | * alpha component. Color values range from 0 to 1. */ 57 | // ---------------------------------------------------------------------------------- 58 | template 59 | class aiColor4t 60 | { 61 | public: 62 | aiColor4t() AI_NO_EXCEPT : r(), g(), b(), a() {} 63 | aiColor4t (TReal _r, TReal _g, TReal _b, TReal _a) 64 | : r(_r), g(_g), b(_b), a(_a) {} 65 | explicit aiColor4t (TReal _r) : r(_r), g(_r), b(_r), a(_r) {} 66 | aiColor4t (const aiColor4t& o) = default; 67 | 68 | public: 69 | // combined operators 70 | const aiColor4t& operator += (const aiColor4t& o); 71 | const aiColor4t& operator -= (const aiColor4t& o); 72 | const aiColor4t& operator *= (TReal f); 73 | const aiColor4t& operator /= (TReal f); 74 | 75 | public: 76 | // comparison 77 | bool operator == (const aiColor4t& other) const; 78 | bool operator != (const aiColor4t& other) const; 79 | bool operator < (const aiColor4t& other) const; 80 | 81 | // color tuple access, rgba order 82 | inline TReal operator[](unsigned int i) const; 83 | inline TReal& operator[](unsigned int i); 84 | 85 | /** check whether a color is (close to) black */ 86 | inline bool IsBlack() const; 87 | 88 | public: 89 | 90 | // Red, green, blue and alpha color values 91 | TReal r, g, b, a; 92 | }; // !struct aiColor4D 93 | 94 | typedef aiColor4t aiColor4D; 95 | 96 | #else 97 | 98 | struct aiColor4D { 99 | ai_real r, g, b, a; 100 | }; 101 | 102 | #endif // __cplusplus 103 | 104 | #endif // AI_COLOR4D_H_INC 105 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/importerdesc.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2019, assimp team 7 | 8 | 9 | 10 | All rights reserved. 11 | 12 | Redistribution and use of this software in source and binary forms, 13 | with or without modification, are permitted provided that the following 14 | conditions are met: 15 | 16 | * Redistributions of source code must retain the above 17 | copyright notice, this list of conditions and the 18 | following disclaimer. 19 | 20 | * Redistributions in binary form must reproduce the above 21 | copyright notice, this list of conditions and the 22 | following disclaimer in the documentation and/or other 23 | materials provided with the distribution. 24 | 25 | * Neither the name of the assimp team, nor the names of its 26 | contributors may be used to endorse or promote products 27 | derived from this software without specific prior 28 | written permission of the assimp team. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | --------------------------------------------------------------------------- 42 | */ 43 | 44 | /** @file importerdesc.h 45 | * @brief #aiImporterFlags, aiImporterDesc implementation. 46 | */ 47 | #pragma once 48 | #ifndef AI_IMPORTER_DESC_H_INC 49 | #define AI_IMPORTER_DESC_H_INC 50 | 51 | 52 | /** Mixed set of flags for #aiImporterDesc, indicating some features 53 | * common to many importers*/ 54 | enum aiImporterFlags 55 | { 56 | /** Indicates that there is a textual encoding of the 57 | * file format; and that it is supported.*/ 58 | aiImporterFlags_SupportTextFlavour = 0x1, 59 | 60 | /** Indicates that there is a binary encoding of the 61 | * file format; and that it is supported.*/ 62 | aiImporterFlags_SupportBinaryFlavour = 0x2, 63 | 64 | /** Indicates that there is a compressed encoding of the 65 | * file format; and that it is supported.*/ 66 | aiImporterFlags_SupportCompressedFlavour = 0x4, 67 | 68 | /** Indicates that the importer reads only a very particular 69 | * subset of the file format. This happens commonly for 70 | * declarative or procedural formats which cannot easily 71 | * be mapped to #aiScene */ 72 | aiImporterFlags_LimitedSupport = 0x8, 73 | 74 | /** Indicates that the importer is highly experimental and 75 | * should be used with care. This only happens for trunk 76 | * (i.e. SVN) versions, experimental code is not included 77 | * in releases. */ 78 | aiImporterFlags_Experimental = 0x10 79 | }; 80 | 81 | 82 | /** Meta information about a particular importer. Importers need to fill 83 | * this structure, but they can freely decide how talkative they are. 84 | * A common use case for loader meta info is a user interface 85 | * in which the user can choose between various import/export file 86 | * formats. Building such an UI by hand means a lot of maintenance 87 | * as importers/exporters are added to Assimp, so it might be useful 88 | * to have a common mechanism to query some rough importer 89 | * characteristics. */ 90 | struct aiImporterDesc 91 | { 92 | /** Full name of the importer (i.e. Blender3D importer)*/ 93 | const char* mName; 94 | 95 | /** Original author (left blank if unknown or whole assimp team) */ 96 | const char* mAuthor; 97 | 98 | /** Current maintainer, left blank if the author maintains */ 99 | const char* mMaintainer; 100 | 101 | /** Implementation comments, i.e. unimplemented features*/ 102 | const char* mComments; 103 | 104 | /** These flags indicate some characteristics common to many 105 | importers. */ 106 | unsigned int mFlags; 107 | 108 | /** Minimum format version that can be loaded im major.minor format, 109 | both are set to 0 if there is either no version scheme 110 | or if the loader doesn't care. */ 111 | unsigned int mMinMajor; 112 | unsigned int mMinMinor; 113 | 114 | /** Maximum format version that can be loaded im major.minor format, 115 | both are set to 0 if there is either no version scheme 116 | or if the loader doesn't care. Loaders that expect to be 117 | forward-compatible to potential future format versions should 118 | indicate zero, otherwise they should specify the current 119 | maximum version.*/ 120 | unsigned int mMaxMajor; 121 | unsigned int mMaxMinor; 122 | 123 | /** List of file extensions this importer can handle. 124 | List entries are separated by space characters. 125 | All entries are lower case without a leading dot (i.e. 126 | "xml dae" would be a valid value. Note that multiple 127 | importers may respond to the same file extension - 128 | assimp calls all importers in the order in which they 129 | are registered and each importer gets the opportunity 130 | to load the file until one importer "claims" the file. Apart 131 | from file extension checks, importers typically use 132 | other methods to quickly reject files (i.e. magic 133 | words) so this does not mean that common or generic 134 | file extensions such as XML would be tediously slow. */ 135 | const char* mFileExtensions; 136 | }; 137 | 138 | /** \brief Returns the Importer description for a given extension. 139 | 140 | Will return a NULL-pointer if no assigned importer desc. was found for the given extension 141 | \param extension [in] The extension to look for 142 | \return A pointer showing to the ImporterDesc, \see aiImporterDesc. 143 | */ 144 | ASSIMP_API const C_STRUCT aiImporterDesc* aiGetImporterDesc( const char *extension ); 145 | 146 | #endif // AI_IMPORTER_DESC_H_INC 147 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/irrXMLWrapper.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2019, assimp team 6 | 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use of this software in source and binary forms, 11 | with or without modification, are permitted provided that the 12 | following conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the 20 | following disclaimer in the documentation and/or other 21 | materials provided with the distribution. 22 | 23 | * Neither the name of the assimp team, nor the names of its 24 | contributors may be used to endorse or promote products 25 | derived from this software without specific prior 26 | written permission of the assimp team. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | 40 | ---------------------------------------------------------------------- 41 | */ 42 | 43 | #ifndef INCLUDED_AI_IRRXML_WRAPPER 44 | #define INCLUDED_AI_IRRXML_WRAPPER 45 | 46 | // some long includes .... 47 | #ifdef ASSIMP_USE_HUNTER 48 | # include 49 | #else 50 | # include 51 | #endif 52 | #include "IOStream.hpp" 53 | #include "BaseImporter.h" 54 | #include 55 | 56 | namespace Assimp { 57 | 58 | // --------------------------------------------------------------------------------- 59 | /** @brief Utility class to make IrrXML work together with our custom IO system 60 | * See the IrrXML docs for more details. 61 | * 62 | * Construct IrrXML-Reader in BaseImporter::InternReadFile(): 63 | * @code 64 | * // open the file 65 | * std::unique_ptr file( pIOHandler->Open( pFile)); 66 | * if( file.get() == NULL) { 67 | * throw DeadlyImportError( "Failed to open file " + pFile + "."); 68 | * } 69 | * 70 | * // generate a XML reader for it 71 | * std::unique_ptr mIOWrapper( new CIrrXML_IOStreamReader( file.get())); 72 | * mReader = irr::io::createIrrXMLReader( mIOWrapper.get()); 73 | * if( !mReader) { 74 | * ThrowException( "xxxx: Unable to open file."); 75 | * } 76 | * @endcode 77 | **/ 78 | class CIrrXML_IOStreamReader : public irr::io::IFileReadCallBack { 79 | public: 80 | 81 | // ---------------------------------------------------------------------------------- 82 | //! Construction from an existing IOStream 83 | explicit CIrrXML_IOStreamReader(IOStream* _stream) 84 | : stream (_stream) 85 | , t (0) 86 | { 87 | 88 | // Map the buffer into memory and convert it to UTF8. IrrXML provides its 89 | // own conversion, which is merely a cast from uintNN_t to uint8_t. Thus, 90 | // it is not suitable for our purposes and we have to do it BEFORE IrrXML 91 | // gets the buffer. Sadly, this forces us to map the whole file into 92 | // memory. 93 | 94 | data.resize(stream->FileSize()); 95 | stream->Read(&data[0],data.size(),1); 96 | 97 | // Remove null characters from the input sequence otherwise the parsing will utterly fail 98 | // std::find is usually much faster than manually iterating 99 | // It is very unlikely that there will be any null characters 100 | auto null_char_iter = std::find(data.begin(), data.end(), '\0'); 101 | 102 | while (null_char_iter != data.end()) 103 | { 104 | null_char_iter = data.erase(null_char_iter); 105 | null_char_iter = std::find(null_char_iter, data.end(), '\0'); 106 | } 107 | 108 | BaseImporter::ConvertToUTF8(data); 109 | } 110 | 111 | // ---------------------------------------------------------------------------------- 112 | //! Virtual destructor 113 | virtual ~CIrrXML_IOStreamReader() {} 114 | 115 | // ---------------------------------------------------------------------------------- 116 | //! Reads an amount of bytes from the file. 117 | /** @param buffer: Pointer to output buffer. 118 | * @param sizeToRead: Amount of bytes to read 119 | * @return Returns how much bytes were read. */ 120 | virtual int read(void* buffer, int sizeToRead) { 121 | if(sizeToRead<0) { 122 | return 0; 123 | } 124 | if(t+sizeToRead>data.size()) { 125 | sizeToRead = static_cast(data.size()-t); 126 | } 127 | 128 | memcpy(buffer,&data.front()+t,sizeToRead); 129 | 130 | t += sizeToRead; 131 | return sizeToRead; 132 | } 133 | 134 | // ---------------------------------------------------------------------------------- 135 | //! Returns size of file in bytes 136 | virtual int getSize() { 137 | return (int)data.size(); 138 | } 139 | 140 | private: 141 | IOStream* stream; 142 | std::vector data; 143 | size_t t; 144 | 145 | }; // ! class CIrrXML_IOStreamReader 146 | 147 | } // ! Assimp 148 | 149 | #endif // !! INCLUDED_AI_IRRXML_WRAPPER 150 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/matrix3x3.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2019, assimp team 7 | 8 | 9 | 10 | All rights reserved. 11 | 12 | Redistribution and use of this software in source and binary forms, 13 | with or without modification, are permitted provided that the following 14 | conditions are met: 15 | 16 | * Redistributions of source code must retain the above 17 | copyright notice, this list of conditions and the 18 | following disclaimer. 19 | 20 | * Redistributions in binary form must reproduce the above 21 | copyright notice, this list of conditions and the 22 | following disclaimer in the documentation and/or other 23 | materials provided with the distribution. 24 | 25 | * Neither the name of the assimp team, nor the names of its 26 | contributors may be used to endorse or promote products 27 | derived from this software without specific prior 28 | written permission of the assimp team. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | --------------------------------------------------------------------------- 42 | */ 43 | 44 | /** @file matrix3x3.h 45 | * @brief Definition of a 3x3 matrix, including operators when compiling in C++ 46 | */ 47 | #pragma once 48 | #ifndef AI_MATRIX3X3_H_INC 49 | #define AI_MATRIX3X3_H_INC 50 | 51 | #include "defs.h" 52 | 53 | #ifdef __cplusplus 54 | 55 | template class aiMatrix4x4t; 56 | template class aiVector2t; 57 | 58 | // --------------------------------------------------------------------------- 59 | /** @brief Represents a row-major 3x3 matrix 60 | * 61 | * There's much confusion about matrix layouts (column vs. row order). 62 | * This is *always* a row-major matrix. Not even with the 63 | * #aiProcess_ConvertToLeftHanded flag, which absolutely does not affect 64 | * matrix order - it just affects the handedness of the coordinate system 65 | * defined thereby. 66 | */ 67 | template 68 | class aiMatrix3x3t 69 | { 70 | public: 71 | 72 | aiMatrix3x3t() AI_NO_EXCEPT : 73 | a1(static_cast(1.0f)), a2(), a3(), 74 | b1(), b2(static_cast(1.0f)), b3(), 75 | c1(), c2(), c3(static_cast(1.0f)) {} 76 | 77 | aiMatrix3x3t ( TReal _a1, TReal _a2, TReal _a3, 78 | TReal _b1, TReal _b2, TReal _b3, 79 | TReal _c1, TReal _c2, TReal _c3) : 80 | a1(_a1), a2(_a2), a3(_a3), 81 | b1(_b1), b2(_b2), b3(_b3), 82 | c1(_c1), c2(_c2), c3(_c3) 83 | {} 84 | 85 | public: 86 | 87 | // matrix multiplication. 88 | aiMatrix3x3t& operator *= (const aiMatrix3x3t& m); 89 | aiMatrix3x3t operator * (const aiMatrix3x3t& m) const; 90 | 91 | // array access operators 92 | TReal* operator[] (unsigned int p_iIndex); 93 | const TReal* operator[] (unsigned int p_iIndex) const; 94 | 95 | // comparison operators 96 | bool operator== (const aiMatrix4x4t& m) const; 97 | bool operator!= (const aiMatrix4x4t& m) const; 98 | 99 | bool Equal(const aiMatrix4x4t& m, TReal epsilon = 1e-6) const; 100 | 101 | template 102 | operator aiMatrix3x3t () const; 103 | 104 | public: 105 | 106 | // ------------------------------------------------------------------- 107 | /** @brief Construction from a 4x4 matrix. The remaining parts 108 | * of the matrix are ignored. 109 | */ 110 | explicit aiMatrix3x3t( const aiMatrix4x4t& pMatrix); 111 | 112 | // ------------------------------------------------------------------- 113 | /** @brief Transpose the matrix 114 | */ 115 | aiMatrix3x3t& Transpose(); 116 | 117 | // ------------------------------------------------------------------- 118 | /** @brief Invert the matrix. 119 | * If the matrix is not invertible all elements are set to qnan. 120 | * Beware, use (f != f) to check whether a TReal f is qnan. 121 | */ 122 | aiMatrix3x3t& Inverse(); 123 | TReal Determinant() const; 124 | 125 | public: 126 | // ------------------------------------------------------------------- 127 | /** @brief Returns a rotation matrix for a rotation around z 128 | * @param a Rotation angle, in radians 129 | * @param out Receives the output matrix 130 | * @return Reference to the output matrix 131 | */ 132 | static aiMatrix3x3t& RotationZ(TReal a, aiMatrix3x3t& out); 133 | 134 | // ------------------------------------------------------------------- 135 | /** @brief Returns a rotation matrix for a rotation around 136 | * an arbitrary axis. 137 | * 138 | * @param a Rotation angle, in radians 139 | * @param axis Axis to rotate around 140 | * @param out To be filled 141 | */ 142 | static aiMatrix3x3t& Rotation( TReal a, 143 | const aiVector3t& axis, aiMatrix3x3t& out); 144 | 145 | // ------------------------------------------------------------------- 146 | /** @brief Returns a translation matrix 147 | * @param v Translation vector 148 | * @param out Receives the output matrix 149 | * @return Reference to the output matrix 150 | */ 151 | static aiMatrix3x3t& Translation( const aiVector2t& v, aiMatrix3x3t& out); 152 | 153 | // ------------------------------------------------------------------- 154 | /** @brief A function for creating a rotation matrix that rotates a 155 | * vector called "from" into another vector called "to". 156 | * Input : from[3], to[3] which both must be *normalized* non-zero vectors 157 | * Output: mtx[3][3] -- a 3x3 matrix in column-major form 158 | * Authors: Tomas Möller, John Hughes 159 | * "Efficiently Building a Matrix to Rotate One Vector to Another" 160 | * Journal of Graphics Tools, 4(4):1-4, 1999 161 | */ 162 | static aiMatrix3x3t& FromToMatrix(const aiVector3t& from, 163 | const aiVector3t& to, aiMatrix3x3t& out); 164 | 165 | public: 166 | TReal a1, a2, a3; 167 | TReal b1, b2, b3; 168 | TReal c1, c2, c3; 169 | }; 170 | 171 | typedef aiMatrix3x3t aiMatrix3x3; 172 | 173 | #else 174 | 175 | struct aiMatrix3x3 { 176 | ai_real a1, a2, a3; 177 | ai_real b1, b2, b3; 178 | ai_real c1, c2, c3; 179 | }; 180 | 181 | #endif // __cplusplus 182 | 183 | #endif // AI_MATRIX3X3_H_INC 184 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/pbrmaterial.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2019, assimp team 7 | 8 | 9 | 10 | All rights reserved. 11 | 12 | Redistribution and use of this software in source and binary forms, 13 | with or without modification, are permitted provided that the following 14 | conditions are met: 15 | 16 | * Redistributions of source code must retain the above 17 | copyright notice, this list of conditions and the 18 | following disclaimer. 19 | 20 | * Redistributions in binary form must reproduce the above 21 | copyright notice, this list of conditions and the 22 | following disclaimer in the documentation and/or other 23 | materials provided with the distribution. 24 | 25 | * Neither the name of the assimp team, nor the names of its 26 | contributors may be used to endorse or promote products 27 | derived from this software without specific prior 28 | written permission of the assimp team. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | --------------------------------------------------------------------------- 42 | */ 43 | 44 | /** @file pbrmaterial.h 45 | * @brief Defines the material system of the library 46 | */ 47 | #ifndef AI_PBRMATERIAL_H_INC 48 | #define AI_PBRMATERIAL_H_INC 49 | 50 | #define AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_BASE_COLOR_FACTOR "$mat.gltf.pbrMetallicRoughness.baseColorFactor", 0, 0 51 | #define AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_METALLIC_FACTOR "$mat.gltf.pbrMetallicRoughness.metallicFactor", 0, 0 52 | #define AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_ROUGHNESS_FACTOR "$mat.gltf.pbrMetallicRoughness.roughnessFactor", 0, 0 53 | #define AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_BASE_COLOR_TEXTURE aiTextureType_DIFFUSE, 1 54 | #define AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_METALLICROUGHNESS_TEXTURE aiTextureType_UNKNOWN, 0 55 | #define AI_MATKEY_GLTF_ALPHAMODE "$mat.gltf.alphaMode", 0, 0 56 | #define AI_MATKEY_GLTF_ALPHACUTOFF "$mat.gltf.alphaCutoff", 0, 0 57 | #define AI_MATKEY_GLTF_PBRSPECULARGLOSSINESS "$mat.gltf.pbrSpecularGlossiness", 0, 0 58 | #define AI_MATKEY_GLTF_PBRSPECULARGLOSSINESS_GLOSSINESS_FACTOR "$mat.gltf.pbrMetallicRoughness.glossinessFactor", 0, 0 59 | #define AI_MATKEY_GLTF_UNLIT "$mat.gltf.unlit", 0, 0 60 | 61 | #define _AI_MATKEY_GLTF_TEXTURE_TEXCOORD_BASE "$tex.file.texCoord" 62 | #define _AI_MATKEY_GLTF_MAPPINGNAME_BASE "$tex.mappingname" 63 | #define _AI_MATKEY_GLTF_MAPPINGID_BASE "$tex.mappingid" 64 | #define _AI_MATKEY_GLTF_MAPPINGFILTER_MAG_BASE "$tex.mappingfiltermag" 65 | #define _AI_MATKEY_GLTF_MAPPINGFILTER_MIN_BASE "$tex.mappingfiltermin" 66 | #define _AI_MATKEY_GLTF_SCALE_BASE "$tex.scale" 67 | #define _AI_MATKEY_GLTF_STRENGTH_BASE "$tex.strength" 68 | 69 | #define AI_MATKEY_GLTF_TEXTURE_TEXCOORD(type, N) _AI_MATKEY_GLTF_TEXTURE_TEXCOORD_BASE, type, N 70 | #define AI_MATKEY_GLTF_MAPPINGNAME(type, N) _AI_MATKEY_GLTF_MAPPINGNAME_BASE, type, N 71 | #define AI_MATKEY_GLTF_MAPPINGID(type, N) _AI_MATKEY_GLTF_MAPPINGID_BASE, type, N 72 | #define AI_MATKEY_GLTF_MAPPINGFILTER_MAG(type, N) _AI_MATKEY_GLTF_MAPPINGFILTER_MAG_BASE, type, N 73 | #define AI_MATKEY_GLTF_MAPPINGFILTER_MIN(type, N) _AI_MATKEY_GLTF_MAPPINGFILTER_MIN_BASE, type, N 74 | #define AI_MATKEY_GLTF_TEXTURE_SCALE(type, N) _AI_MATKEY_GLTF_SCALE_BASE, type, N 75 | #define AI_MATKEY_GLTF_TEXTURE_STRENGTH(type, N) _AI_MATKEY_GLTF_STRENGTH_BASE, type, N 76 | 77 | #endif //!!AI_PBRMATERIAL_H_INC 78 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/port/AndroidJNI/AndroidJNIIOSystem.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2016, assimp team 6 | All rights reserved. 7 | 8 | Redistribution and use of this software in source and binary forms, 9 | with or without modification, are permitted provided that the 10 | following conditions are met: 11 | 12 | * Redistributions of source code must retain the above 13 | copyright notice, this list of conditions and the 14 | following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above 17 | copyright notice, this list of conditions and the 18 | following disclaimer in the documentation and/or other 19 | materials provided with the distribution. 20 | 21 | * Neither the name of the assimp team, nor the names of its 22 | contributors may be used to endorse or promote products 23 | derived from this software without specific prior 24 | written permission of the assimp team. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 29 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 30 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 32 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | 38 | ---------------------------------------------------------------------- 39 | */ 40 | 41 | /** @file Android implementation of IOSystem using the standard C file functions. 42 | * Aimed to ease the access to android assets */ 43 | 44 | #if __ANDROID__ and __ANDROID_API__ > 9 and defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT) 45 | #ifndef AI_ANDROIDJNIIOSYSTEM_H_INC 46 | #define AI_ANDROIDJNIIOSYSTEM_H_INC 47 | 48 | #include 49 | #include 50 | #include 51 | #include 52 | 53 | namespace Assimp { 54 | 55 | // --------------------------------------------------------------------------- 56 | /** Android extension to DefaultIOSystem using the standard C file functions */ 57 | class ASSIMP_API AndroidJNIIOSystem : public DefaultIOSystem 58 | { 59 | public: 60 | 61 | /** Initialize android activity data */ 62 | std::string mApkWorkspacePath; 63 | AAssetManager* mApkAssetManager; 64 | 65 | /** Constructor. */ 66 | AndroidJNIIOSystem(ANativeActivity* activity); 67 | 68 | /** Destructor. */ 69 | ~AndroidJNIIOSystem(); 70 | 71 | // ------------------------------------------------------------------- 72 | /** Tests for the existence of a file at the given path. */ 73 | bool Exists( const char* pFile) const; 74 | 75 | // ------------------------------------------------------------------- 76 | /** Opens a file at the given path, with given mode */ 77 | IOStream* Open( const char* strFile, const char* strMode); 78 | 79 | // ------------------------------------------------------------------------------------------------ 80 | // Inits Android extractor 81 | void AndroidActivityInit(ANativeActivity* activity); 82 | 83 | // ------------------------------------------------------------------------------------------------ 84 | // Extracts android asset 85 | bool AndroidExtractAsset(std::string name); 86 | 87 | }; 88 | 89 | } //!ns Assimp 90 | 91 | #endif //AI_ANDROIDJNIIOSYSTEM_H_INC 92 | #endif //__ANDROID__ and __ANDROID_API__ > 9 and defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT) 93 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/qnan.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2019, assimp team 7 | 8 | 9 | 10 | All rights reserved. 11 | 12 | Redistribution and use of this software in source and binary forms, 13 | with or without modification, are permitted provided that the following 14 | conditions are met: 15 | 16 | * Redistributions of source code must retain the above 17 | copyright notice, this list of conditions and the 18 | following disclaimer. 19 | 20 | * Redistributions in binary form must reproduce the above 21 | copyright notice, this list of conditions and the 22 | following disclaimer in the documentation and/or other 23 | materials provided with the distribution. 24 | 25 | * Neither the name of the assimp team, nor the names of its 26 | contributors may be used to endorse or promote products 27 | derived from this software without specific prior 28 | written permission of the assimp team. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | --------------------------------------------------------------------------- 42 | */ 43 | 44 | /** @file qnan.h 45 | * @brief Some utilities for our dealings with qnans. 46 | * 47 | * @note Some loaders use qnans to mark invalid values tempoarily, also 48 | * Assimp explicitly enforces undefined normals to be set to qnan. 49 | * qnan utilities are available in standard libraries (C99 for example) 50 | * but last time I checked compiler coverage was so bad that I decided 51 | * to reinvent the wheel. 52 | */ 53 | 54 | #ifndef AI_QNAN_H_INCLUDED 55 | #define AI_QNAN_H_INCLUDED 56 | 57 | #include 58 | #include 59 | #include 60 | 61 | // --------------------------------------------------------------------------- 62 | /** Data structure to represent the bit pattern of a 32 Bit 63 | * IEEE 754 floating-point number. */ 64 | union _IEEESingle 65 | { 66 | float Float; 67 | struct 68 | { 69 | uint32_t Frac : 23; 70 | uint32_t Exp : 8; 71 | uint32_t Sign : 1; 72 | } IEEE; 73 | }; 74 | 75 | // --------------------------------------------------------------------------- 76 | /** Data structure to represent the bit pattern of a 64 Bit 77 | * IEEE 754 floating-point number. */ 78 | union _IEEEDouble 79 | { 80 | double Double; 81 | struct 82 | { 83 | uint64_t Frac : 52; 84 | uint64_t Exp : 11; 85 | uint64_t Sign : 1; 86 | } IEEE; 87 | }; 88 | 89 | // --------------------------------------------------------------------------- 90 | /** Check whether a given float is qNaN. 91 | * @param in Input value */ 92 | AI_FORCE_INLINE bool is_qnan(float in) 93 | { 94 | // the straightforward solution does not work: 95 | // return (in != in); 96 | // compiler generates code like this 97 | // load to 98 | // compare against 99 | 100 | // FIXME: Use stuff instead? I think fpclassify needs C99 101 | _IEEESingle temp; 102 | memcpy(&temp, &in, sizeof(float)); 103 | return (temp.IEEE.Exp == (1u << 8)-1 && 104 | temp.IEEE.Frac); 105 | } 106 | 107 | // --------------------------------------------------------------------------- 108 | /** Check whether a given double is qNaN. 109 | * @param in Input value */ 110 | AI_FORCE_INLINE bool is_qnan(double in) 111 | { 112 | // the straightforward solution does not work: 113 | // return (in != in); 114 | // compiler generates code like this 115 | // load to 116 | // compare against 117 | 118 | // FIXME: Use stuff instead? I think fpclassify needs C99 119 | _IEEEDouble temp; 120 | memcpy(&temp, &in, sizeof(in)); 121 | return (temp.IEEE.Exp == (1u << 11)-1 && 122 | temp.IEEE.Frac); 123 | } 124 | 125 | // --------------------------------------------------------------------------- 126 | /** @brief check whether a float is either NaN or (+/-) INF. 127 | * 128 | * Denorms return false, they're treated like normal values. 129 | * @param in Input value */ 130 | AI_FORCE_INLINE bool is_special_float(float in) 131 | { 132 | _IEEESingle temp; 133 | memcpy(&temp, &in, sizeof(float)); 134 | return (temp.IEEE.Exp == (1u << 8)-1); 135 | } 136 | 137 | // --------------------------------------------------------------------------- 138 | /** @brief check whether a double is either NaN or (+/-) INF. 139 | * 140 | * Denorms return false, they're treated like normal values. 141 | * @param in Input value */ 142 | AI_FORCE_INLINE bool is_special_float(double in) 143 | { 144 | _IEEESingle temp; 145 | memcpy(&temp, &in, sizeof(float)); 146 | return (temp.IEEE.Exp == (1u << 11)-1); 147 | } 148 | 149 | // --------------------------------------------------------------------------- 150 | /** Check whether a float is NOT qNaN. 151 | * @param in Input value */ 152 | template 153 | AI_FORCE_INLINE bool is_not_qnan(TReal in) 154 | { 155 | return !is_qnan(in); 156 | } 157 | 158 | // --------------------------------------------------------------------------- 159 | /** @brief Get a fresh qnan. */ 160 | AI_FORCE_INLINE ai_real get_qnan() 161 | { 162 | return std::numeric_limits::quiet_NaN(); 163 | } 164 | 165 | #endif // !! AI_QNAN_H_INCLUDED 166 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/quaternion.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2019, assimp team 6 | 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use of this software in source and binary forms, 11 | with or without modification, are permitted provided that the 12 | following conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the 20 | following disclaimer in the documentation and/or other 21 | materials provided with the distribution. 22 | 23 | * Neither the name of the assimp team, nor the names of its 24 | contributors may be used to endorse or promote products 25 | derived from this software without specific prior 26 | written permission of the assimp team. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | 40 | ---------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file quaternion.h 44 | * @brief Quaternion structure, including operators when compiling in C++ 45 | */ 46 | #pragma once 47 | #ifndef AI_QUATERNION_H_INC 48 | #define AI_QUATERNION_H_INC 49 | 50 | #ifdef __cplusplus 51 | 52 | #include "defs.h" 53 | 54 | template class aiVector3t; 55 | template class aiMatrix3x3t; 56 | 57 | // --------------------------------------------------------------------------- 58 | /** Represents a quaternion in a 4D vector. */ 59 | template 60 | class aiQuaterniont 61 | { 62 | public: 63 | aiQuaterniont() AI_NO_EXCEPT : w(1.0), x(), y(), z() {} 64 | aiQuaterniont(TReal pw, TReal px, TReal py, TReal pz) 65 | : w(pw), x(px), y(py), z(pz) {} 66 | 67 | /** Construct from rotation matrix. Result is undefined if the matrix is not orthonormal. */ 68 | explicit aiQuaterniont( const aiMatrix3x3t& pRotMatrix); 69 | 70 | /** Construct from euler angles */ 71 | aiQuaterniont( TReal rotx, TReal roty, TReal rotz); 72 | 73 | /** Construct from an axis-angle pair */ 74 | aiQuaterniont( aiVector3t axis, TReal angle); 75 | 76 | /** Construct from a normalized quaternion stored in a vec3 */ 77 | explicit aiQuaterniont( aiVector3t normalized); 78 | 79 | /** Returns a matrix representation of the quaternion */ 80 | aiMatrix3x3t GetMatrix() const; 81 | 82 | public: 83 | 84 | bool operator== (const aiQuaterniont& o) const; 85 | bool operator!= (const aiQuaterniont& o) const; 86 | 87 | bool Equal(const aiQuaterniont& o, TReal epsilon = 1e-6) const; 88 | 89 | public: 90 | 91 | /** Normalize the quaternion */ 92 | aiQuaterniont& Normalize(); 93 | 94 | /** Compute quaternion conjugate */ 95 | aiQuaterniont& Conjugate (); 96 | 97 | /** Rotate a point by this quaternion */ 98 | aiVector3t Rotate (const aiVector3t& in); 99 | 100 | /** Multiply two quaternions */ 101 | aiQuaterniont operator* (const aiQuaterniont& two) const; 102 | 103 | public: 104 | 105 | /** Performs a spherical interpolation between two quaternions and writes the result into the third. 106 | * @param pOut Target object to received the interpolated rotation. 107 | * @param pStart Start rotation of the interpolation at factor == 0. 108 | * @param pEnd End rotation, factor == 1. 109 | * @param pFactor Interpolation factor between 0 and 1. Values outside of this range yield undefined results. 110 | */ 111 | static void Interpolate( aiQuaterniont& pOut, const aiQuaterniont& pStart, 112 | const aiQuaterniont& pEnd, TReal pFactor); 113 | 114 | public: 115 | 116 | //! w,x,y,z components of the quaternion 117 | TReal w, x, y, z; 118 | } ; 119 | 120 | typedef aiQuaterniont aiQuaternion; 121 | 122 | #else 123 | 124 | struct aiQuaternion { 125 | ai_real w, x, y, z; 126 | }; 127 | 128 | #endif 129 | 130 | #endif // AI_QUATERNION_H_INC 131 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/vector2.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2019, assimp team 7 | 8 | 9 | 10 | All rights reserved. 11 | 12 | Redistribution and use of this software in source and binary forms, 13 | with or without modification, are permitted provided that the following 14 | conditions are met: 15 | 16 | * Redistributions of source code must retain the above 17 | copyright notice, this list of conditions and the 18 | following disclaimer. 19 | 20 | * Redistributions in binary form must reproduce the above 21 | copyright notice, this list of conditions and the 22 | following disclaimer in the documentation and/or other 23 | materials provided with the distribution. 24 | 25 | * Neither the name of the assimp team, nor the names of its 26 | contributors may be used to endorse or promote products 27 | derived from this software without specific prior 28 | written permission of the assimp team. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | --------------------------------------------------------------------------- 42 | */ 43 | /** @file vector2.h 44 | * @brief 2D vector structure, including operators when compiling in C++ 45 | */ 46 | #pragma once 47 | #ifndef AI_VECTOR2D_H_INC 48 | #define AI_VECTOR2D_H_INC 49 | 50 | #ifdef __cplusplus 51 | # include 52 | #else 53 | # include 54 | #endif 55 | 56 | #include "defs.h" 57 | 58 | // ---------------------------------------------------------------------------------- 59 | /** Represents a two-dimensional vector. 60 | */ 61 | 62 | #ifdef __cplusplus 63 | template 64 | class aiVector2t { 65 | public: 66 | aiVector2t () : x(), y() {} 67 | aiVector2t (TReal _x, TReal _y) : x(_x), y(_y) {} 68 | explicit aiVector2t (TReal _xyz) : x(_xyz), y(_xyz) {} 69 | aiVector2t (const aiVector2t& o) = default; 70 | 71 | void Set( TReal pX, TReal pY); 72 | TReal SquareLength() const ; 73 | TReal Length() const ; 74 | aiVector2t& Normalize(); 75 | 76 | const aiVector2t& operator += (const aiVector2t& o); 77 | const aiVector2t& operator -= (const aiVector2t& o); 78 | const aiVector2t& operator *= (TReal f); 79 | const aiVector2t& operator /= (TReal f); 80 | 81 | TReal operator[](unsigned int i) const; 82 | 83 | bool operator== (const aiVector2t& other) const; 84 | bool operator!= (const aiVector2t& other) const; 85 | 86 | bool Equal(const aiVector2t& other, TReal epsilon = 1e-6) const; 87 | 88 | aiVector2t& operator= (TReal f); 89 | const aiVector2t SymMul(const aiVector2t& o); 90 | 91 | template 92 | operator aiVector2t () const; 93 | 94 | TReal x, y; 95 | }; 96 | 97 | typedef aiVector2t aiVector2D; 98 | 99 | #else 100 | 101 | struct aiVector2D { 102 | ai_real x, y; 103 | }; 104 | 105 | #endif // __cplusplus 106 | 107 | #endif // AI_VECTOR2D_H_INC 108 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/vector3.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2019, assimp team 7 | 8 | 9 | 10 | All rights reserved. 11 | 12 | Redistribution and use of this software in source and binary forms, 13 | with or without modification, are permitted provided that the following 14 | conditions are met: 15 | 16 | * Redistributions of source code must retain the above 17 | copyright notice, this list of conditions and the 18 | following disclaimer. 19 | 20 | * Redistributions in binary form must reproduce the above 21 | copyright notice, this list of conditions and the 22 | following disclaimer in the documentation and/or other 23 | materials provided with the distribution. 24 | 25 | * Neither the name of the assimp team, nor the names of its 26 | contributors may be used to endorse or promote products 27 | derived from this software without specific prior 28 | written permission of the assimp team. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | --------------------------------------------------------------------------- 42 | */ 43 | /** @file vector3.h 44 | * @brief 3D vector structure, including operators when compiling in C++ 45 | */ 46 | #pragma once 47 | #ifndef AI_VECTOR3D_H_INC 48 | #define AI_VECTOR3D_H_INC 49 | 50 | #ifdef __cplusplus 51 | # include 52 | #else 53 | # include 54 | #endif 55 | 56 | #include "defs.h" 57 | 58 | #ifdef __cplusplus 59 | 60 | template class aiMatrix3x3t; 61 | template class aiMatrix4x4t; 62 | 63 | // --------------------------------------------------------------------------- 64 | /** Represents a three-dimensional vector. */ 65 | template 66 | class aiVector3t 67 | { 68 | public: 69 | aiVector3t() AI_NO_EXCEPT : x(), y(), z() {} 70 | aiVector3t(TReal _x, TReal _y, TReal _z) : x(_x), y(_y), z(_z) {} 71 | explicit aiVector3t (TReal _xyz ) : x(_xyz), y(_xyz), z(_xyz) {} 72 | aiVector3t( const aiVector3t& o ) = default; 73 | 74 | public: 75 | 76 | // combined operators 77 | const aiVector3t& operator += (const aiVector3t& o); 78 | const aiVector3t& operator -= (const aiVector3t& o); 79 | const aiVector3t& operator *= (TReal f); 80 | const aiVector3t& operator /= (TReal f); 81 | 82 | // transform vector by matrix 83 | aiVector3t& operator *= (const aiMatrix3x3t& mat); 84 | aiVector3t& operator *= (const aiMatrix4x4t& mat); 85 | 86 | // access a single element 87 | TReal operator[](unsigned int i) const; 88 | TReal& operator[](unsigned int i); 89 | 90 | // comparison 91 | bool operator== (const aiVector3t& other) const; 92 | bool operator!= (const aiVector3t& other) const; 93 | bool operator < (const aiVector3t& other) const; 94 | 95 | bool Equal(const aiVector3t& other, TReal epsilon = 1e-6) const; 96 | 97 | template 98 | operator aiVector3t () const; 99 | 100 | public: 101 | /** @brief Set the components of a vector 102 | * @param pX X component 103 | * @param pY Y component 104 | * @param pZ Z component */ 105 | void Set( TReal pX, TReal pY, TReal pZ); 106 | 107 | /** @brief Get the squared length of the vector 108 | * @return Square length */ 109 | TReal SquareLength() const; 110 | 111 | /** @brief Get the length of the vector 112 | * @return length */ 113 | TReal Length() const; 114 | 115 | 116 | /** @brief Normalize the vector */ 117 | aiVector3t& Normalize(); 118 | 119 | /** @brief Normalize the vector with extra check for zero vectors */ 120 | aiVector3t& NormalizeSafe(); 121 | 122 | /** @brief Componentwise multiplication of two vectors 123 | * 124 | * Note that vec*vec yields the dot product. 125 | * @param o Second factor */ 126 | const aiVector3t SymMul(const aiVector3t& o); 127 | 128 | TReal x, y, z; 129 | }; 130 | 131 | 132 | typedef aiVector3t aiVector3D; 133 | 134 | #else 135 | 136 | struct aiVector3D { 137 | ai_real x, y, z; 138 | }; 139 | 140 | #endif // __cplusplus 141 | 142 | #ifdef __cplusplus 143 | 144 | #endif // __cplusplus 145 | 146 | #endif // AI_VECTOR3D_H_INC 147 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2019, assimp team 7 | 8 | 9 | 10 | All rights reserved. 11 | 12 | Redistribution and use of this software in source and binary forms, 13 | with or without modification, are permitted provided that the following 14 | conditions are met: 15 | 16 | * Redistributions of source code must retain the above 17 | copyright notice, this list of conditions and the 18 | following disclaimer. 19 | 20 | * Redistributions in binary form must reproduce the above 21 | copyright notice, this list of conditions and the 22 | following disclaimer in the documentation and/or other 23 | materials provided with the distribution. 24 | 25 | * Neither the name of the assimp team, nor the names of its 26 | contributors may be used to endorse or promote products 27 | derived from this software without specific prior 28 | written permission of the assimp team. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | --------------------------------------------------------------------------- 42 | */ 43 | 44 | /** @file version.h 45 | * @brief Functions to query the version of the Assimp runtime, check 46 | * compile flags, ... 47 | */ 48 | #pragma once 49 | #ifndef AI_VERSION_H_INC 50 | #define AI_VERSION_H_INC 51 | 52 | #include "defs.h" 53 | 54 | #ifdef __cplusplus 55 | extern "C" { 56 | #endif 57 | 58 | // --------------------------------------------------------------------------- 59 | /** @brief Returns a string with legal copyright and licensing information 60 | * about Assimp. The string may include multiple lines. 61 | * @return Pointer to static string. 62 | */ 63 | ASSIMP_API const char* aiGetLegalString (void); 64 | 65 | // --------------------------------------------------------------------------- 66 | /** @brief Returns the current minor version number of Assimp. 67 | * @return Minor version of the Assimp runtime the application was 68 | * linked/built against 69 | */ 70 | ASSIMP_API unsigned int aiGetVersionMinor (void); 71 | 72 | // --------------------------------------------------------------------------- 73 | /** @brief Returns the current major version number of Assimp. 74 | * @return Major version of the Assimp runtime the application was 75 | * linked/built against 76 | */ 77 | ASSIMP_API unsigned int aiGetVersionMajor (void); 78 | 79 | // --------------------------------------------------------------------------- 80 | /** @brief Returns the repository revision of the Assimp runtime. 81 | * @return SVN Repository revision number of the Assimp runtime the 82 | * application was linked/built against. 83 | */ 84 | ASSIMP_API unsigned int aiGetVersionRevision (void); 85 | 86 | // --------------------------------------------------------------------------- 87 | /** @brief Returns the branchname of the Assimp runtime. 88 | * @return The current branch name. 89 | */ 90 | ASSIMP_API const char *aiGetBranchName(); 91 | 92 | //! Assimp was compiled as a shared object (Windows: DLL) 93 | #define ASSIMP_CFLAGS_SHARED 0x1 94 | //! Assimp was compiled against STLport 95 | #define ASSIMP_CFLAGS_STLPORT 0x2 96 | //! Assimp was compiled as a debug build 97 | #define ASSIMP_CFLAGS_DEBUG 0x4 98 | 99 | //! Assimp was compiled with ASSIMP_BUILD_BOOST_WORKAROUND defined 100 | #define ASSIMP_CFLAGS_NOBOOST 0x8 101 | //! Assimp was compiled with ASSIMP_BUILD_SINGLETHREADED defined 102 | #define ASSIMP_CFLAGS_SINGLETHREADED 0x10 103 | 104 | // --------------------------------------------------------------------------- 105 | /** @brief Returns assimp's compile flags 106 | * @return Any bitwise combination of the ASSIMP_CFLAGS_xxx constants. 107 | */ 108 | ASSIMP_API unsigned int aiGetCompileFlags (void); 109 | 110 | #ifdef __cplusplus 111 | } // end extern "C" 112 | #endif 113 | 114 | #endif // !! #ifndef AI_VERSION_H_INC 115 | 116 | -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/IrrXML.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/ThirdParty/assimp/lib/IrrXML.lib -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/assimp-vc142-mt.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/ThirdParty/assimp/lib/assimp-vc142-mt.exp -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/assimp-vc142-mt.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/ThirdParty/assimp/lib/assimp-vc142-mt.lib -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/libassimp.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/ThirdParty/assimp/lib/libassimp.so -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/zlib.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/ThirdParty/assimp/lib/zlib.exp -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/zlib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/ThirdParty/assimp/lib/zlib.lib -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/zlibstatic.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chrizey91/RuntimeMeshLoader/a29e731c2141418357bd675edbc4f65b40b56107/ThirdParty/assimp/lib/zlibstatic.lib --------------------------------------------------------------------------------