├── Binaries └── Win64 │ └── assimp-vc140-mt.dll ├── .gitattributes ├── BlueprintExample.PNG ├── ThirdParty └── assimp │ ├── bin │ ├── Mac │ │ ├── unit │ │ └── assimp │ ├── Win32 │ │ ├── unit.exe │ │ ├── zlib.dll │ │ ├── assimp.exe │ │ └── assimp-vc140-mt.dll │ └── Win64 │ │ ├── unit.exe │ │ ├── zlib.dll │ │ ├── assimp.exe │ │ └── assimp-vc140-mt.dll │ ├── lib │ ├── Win32 │ │ ├── zlib.exp │ │ ├── zlib.lib │ │ ├── IrrXML.lib │ │ ├── Debug │ │ │ ├── IrrXML.lib │ │ │ ├── IrrXML.pdb │ │ │ ├── zlibd.exp │ │ │ ├── zlibd.lib │ │ │ ├── zlibstaticd.lib │ │ │ ├── assimp-vc140-mt.exp │ │ │ └── assimp-vc140-mt.lib │ │ ├── zlibstatic.lib │ │ ├── assimp-vc140-mt.exp │ │ └── assimp-vc140-mt.lib │ ├── Win64 │ │ ├── zlib.exp │ │ ├── zlib.lib │ │ ├── IrrXML.lib │ │ ├── zlibstatic.lib │ │ ├── assimp-vc140-mt.exp │ │ └── assimp-vc140-mt.lib │ └── Mac │ │ ├── libIrrXML.a │ │ ├── libassimp.4.1.0.dylib │ │ ├── libassimp.4.dylib │ │ └── libassimp.dylib │ └── include │ └── assimp │ ├── Compiler │ ├── poppack1.h │ └── pushpack1.h │ ├── Defines.h │ ├── ai_assert.h │ ├── NullLogger.hpp │ ├── port │ └── AndroidJNI │ │ └── AndroidJNIIOSystem.h │ ├── color4.h │ ├── vector2.h │ ├── DefaultIOSystem.h │ ├── LogStream.hpp │ ├── version.h │ ├── quaternion.h │ ├── vector3.h │ ├── cfileio.h │ ├── DefaultIOStream.h │ ├── IOStream.hpp │ ├── ProgressHandler.hpp │ ├── importerdesc.h │ ├── matrix3x3.h │ ├── DefaultLogger.hpp │ ├── texture.h │ ├── camera.h │ ├── vector2.inl │ ├── color4.inl │ ├── light.h │ ├── metadata.h │ ├── Logger.hpp │ ├── defs.h │ ├── quaternion.inl │ └── matrix4x4.h ├── Config └── FilterPlugin.ini ├── Source ├── Public │ ├── RuntimeStaticMeshImporter.h │ └── RuntimeStaticMeshImporterBFL.h ├── Private │ └── RuntimeStaticMeshImporter.cpp └── RuntimeStaticMeshImporter.Build.cs ├── RuntimeStaticMeshImporter.uplugin ├── .gitignore ├── README.md └── LICENSE /Binaries/Win64/assimp-vc140-mt.dll: -------------------------------------------------------------------------------- 1 | // 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /BlueprintExample.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/BlueprintExample.PNG -------------------------------------------------------------------------------- /ThirdParty/assimp/bin/Mac/unit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/bin/Mac/unit -------------------------------------------------------------------------------- /ThirdParty/assimp/bin/Mac/assimp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/bin/Mac/assimp -------------------------------------------------------------------------------- /ThirdParty/assimp/bin/Win32/unit.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/bin/Win32/unit.exe -------------------------------------------------------------------------------- /ThirdParty/assimp/bin/Win32/zlib.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/bin/Win32/zlib.dll -------------------------------------------------------------------------------- /ThirdParty/assimp/bin/Win64/unit.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/bin/Win64/unit.exe -------------------------------------------------------------------------------- /ThirdParty/assimp/bin/Win64/zlib.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/bin/Win64/zlib.dll -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/Win32/zlib.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/lib/Win32/zlib.exp -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/Win32/zlib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/lib/Win32/zlib.lib -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/Win64/zlib.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/lib/Win64/zlib.exp -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/Win64/zlib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/lib/Win64/zlib.lib -------------------------------------------------------------------------------- /ThirdParty/assimp/bin/Win32/assimp.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/bin/Win32/assimp.exe -------------------------------------------------------------------------------- /ThirdParty/assimp/bin/Win64/assimp.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/bin/Win64/assimp.exe -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/Mac/libIrrXML.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/lib/Mac/libIrrXML.a -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/Win32/IrrXML.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/lib/Win32/IrrXML.lib -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/Win64/IrrXML.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/lib/Win64/IrrXML.lib -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/Win32/Debug/IrrXML.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/lib/Win32/Debug/IrrXML.lib -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/Win32/Debug/IrrXML.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/lib/Win32/Debug/IrrXML.pdb -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/Win32/Debug/zlibd.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/lib/Win32/Debug/zlibd.exp -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/Win32/Debug/zlibd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/lib/Win32/Debug/zlibd.lib -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/Win32/zlibstatic.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/lib/Win32/zlibstatic.lib -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/Win64/zlibstatic.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/lib/Win64/zlibstatic.lib -------------------------------------------------------------------------------- /ThirdParty/assimp/bin/Win32/assimp-vc140-mt.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/bin/Win32/assimp-vc140-mt.dll -------------------------------------------------------------------------------- /ThirdParty/assimp/bin/Win64/assimp-vc140-mt.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/bin/Win64/assimp-vc140-mt.dll -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/Mac/libassimp.4.1.0.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/lib/Mac/libassimp.4.1.0.dylib -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/Win32/Debug/zlibstaticd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/lib/Win32/Debug/zlibstaticd.lib -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/Win32/assimp-vc140-mt.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/lib/Win32/assimp-vc140-mt.exp -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/Win32/assimp-vc140-mt.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/lib/Win32/assimp-vc140-mt.lib -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/Win64/assimp-vc140-mt.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/lib/Win64/assimp-vc140-mt.exp -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/Win64/assimp-vc140-mt.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/lib/Win64/assimp-vc140-mt.lib -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/Win32/Debug/assimp-vc140-mt.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/lib/Win32/Debug/assimp-vc140-mt.exp -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/Win32/Debug/assimp-vc140-mt.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevesDev/RuntimeStaticMeshImporter/HEAD/ThirdParty/assimp/lib/Win32/Debug/assimp-vc140-mt.lib -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Source/Public/RuntimeStaticMeshImporter.h: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | #pragma once 4 | 5 | //#include "CoreMinimal.h" 6 | #include "Engine.h" 7 | #include "Modules/ModuleManager.h" 8 | 9 | class RUNTIMESTATICMESHIMPORTER_API FRuntimeStaticMeshImporterModule : public IModuleInterface 10 | { 11 | 12 | public: 13 | 14 | /** IModuleInterface implementation */ 15 | virtual void StartupModule() override; 16 | virtual void ShutdownModule() override; 17 | 18 | }; 19 | -------------------------------------------------------------------------------- /RuntimeStaticMeshImporter.uplugin: -------------------------------------------------------------------------------- 1 | { 2 | "FileVersion": 3, 3 | "Version": 1, 4 | "VersionName": "1.0", 5 | "FriendlyName": "RuntimeStaticMeshImporter", 6 | "Description": "Load fbx mesh at runtime and convert it to a static mesh", 7 | "Category": "Other", 8 | "CreatedBy": "Riane", 9 | "CreatedByURL": "", 10 | "DocsURL": "", 11 | "MarketplaceURL": "", 12 | "SupportURL": "", 13 | "CanContainContent": true, 14 | "IsBetaVersion": true, 15 | "IsExperimentalVersion": false, 16 | "Installed": false, 17 | "Modules": [ 18 | { 19 | "Name": "RuntimeStaticMeshImporter", 20 | "Type": "Runtime", 21 | "LoadingPhase": "Default", 22 | "WhitelistPlatforms": [ 23 | "Win32", 24 | "Win64" 25 | ] 26 | } 27 | ] 28 | } -------------------------------------------------------------------------------- /Source/Private/RuntimeStaticMeshImporter.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "RuntimeStaticMeshImporter.h" 4 | 5 | #define LOCTEXT_NAMESPACE "FRuntimeStaticMeshImporterModule" 6 | 7 | void FRuntimeStaticMeshImporterModule::StartupModule() 8 | { 9 | // This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module 10 | 11 | } 12 | 13 | void FRuntimeStaticMeshImporterModule::ShutdownModule() 14 | { 15 | // This function may be called during shutdown to clean up your module. For modules that support dynamic reloading, 16 | // we call this function before unloading the module. 17 | } 18 | 19 | #undef LOCTEXT_NAMESPACE 20 | 21 | IMPLEMENT_MODULE(FRuntimeStaticMeshImporterModule, RuntimeStaticMeshImporter) -------------------------------------------------------------------------------- /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/lib/Mac/libassimp.4.dylib: -------------------------------------------------------------------------------- 1 | XSym 2 | 0021 3 | ac79796e151e8fc1610a62152b939318 4 | libassimp.4.1.0.dylib 5 | -------------------------------------------------------------------------------- /ThirdParty/assimp/lib/Mac/libassimp.dylib: -------------------------------------------------------------------------------- 1 | XSym 2 | 0017 3 | 6ee7490a61305b63e7a0ca5da48b68f8 4 | libassimp.4.dylib 5 | -------------------------------------------------------------------------------- /.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 | Plugins/*/Binaries/* 51 | 52 | # Builds 53 | Build/* 54 | 55 | # Whitelist PakBlacklist-.txt files 56 | !Build/*/ 57 | Build/*/** 58 | !Build/*/PakBlacklist*.txt 59 | 60 | # Don't ignore icon files in Build 61 | !Build/**/*.ico 62 | 63 | # Built data for maps 64 | *_BuiltData.uasset 65 | 66 | # Configuration files generated by the Editor 67 | Saved/* 68 | 69 | # Compiled source files for the engine to use 70 | Intermediate/* 71 | Plugins/*/Intermediate/* 72 | 73 | # Cache files for the editor to use 74 | DerivedDataCache/* 75 | -------------------------------------------------------------------------------- /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__ ) 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RuntimeStaticMeshImporter 2 | Plugin for loading static mesh at runtime from fbx files. 3 | 4 | Select the UCG Directory (whatever folder within your project directory that you want to store player made fbx) and assign it in the "Get UGC Directories and FBX" node. 5 | 6 | Connect the output paths struct to the "Load FBX File" node. It will search the directory for any FBX objects and create data from the mesh within, then build mesh data. 7 | 8 | Plug FBX Data output (the array returned from "Load FBX File") into "Create PMC From Data" node. This will create a temporary procedural mesh. You can use this but I suggest converting to static mesh to save resources. 9 | 10 | Plug the output of 'Out Mesh' into "Populate Static Mesh From PMC", what your static mesh component as the target. It will build a new static mesh for that component. 11 | 12 | You can take the 'Textures' array from the STMI Object Data (from "Load FBX File") to assign the mesh material textures. 13 | 14 | See the example image for blueprint example. 15 | 16 | 17 | If you are having issues with packaging your build/the system complaining about the assimp dll being missing, look in your packaged project for a 'Plugins/RuntimeStaticMeshImporter' folder and follow it until you find the assimp-vc140-mt.dll. 18 | Copy this and paste it in Project/Binaries/Win64. 19 | 20 | The system works best with FBX files that have a single, solid mesh. If something looks weird when importing, it may be that there are too many meshes within the FBX, or your normals might be off. Make sure to check them. 21 | Replication works fine for lower-poly objects, but with high-poly objects there is a hardcap on array limits. This could result in a client being kicked from the server if the array gets too big. Am working on this. 22 | 23 | 24 | ![BlueprintExample](https://github.com/RianeDev/RuntimeStaticMeshImporter/assets/42573189/e13f4074-e011-4267-8503-27ac17b1333a) 25 | 26 | 27 | Example using a mini STL converted to FBX in Blender: 28 | 29 | ![1](https://github.com/RianeDev/RuntimeStaticMeshImporter/assets/42573189/b8c54f76-87b0-4e41-b4ec-51b18566d4fd) 30 | -------------------------------------------------------------------------------- /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/ai_assert.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2017, assimp team 7 | 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following 13 | conditions are met: 14 | 15 | * Redistributions of source code must retain the above 16 | copyright notice, this list of conditions and the 17 | following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the 21 | following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | 24 | * Neither the name of the assimp team, nor the names of its 25 | contributors may be used to endorse or promote products 26 | derived from this software without specific prior 27 | written permission of the assimp team. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | --------------------------------------------------------------------------- 41 | */ 42 | #pragma once 43 | #ifndef AI_ASSERT_H_INC 44 | #define AI_ASSERT_H_INC 45 | 46 | #ifdef ASSIMP_BUILD_DEBUG 47 | # include 48 | # define ai_assert(expression) assert(expression) 49 | #else 50 | # define ai_assert(expression) 51 | #endif // 52 | 53 | #endif // AI_ASSERT_H_INC 54 | -------------------------------------------------------------------------------- /Source/RuntimeStaticMeshImporter.Build.cs: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | using System.IO; 4 | using UnrealBuildTool; 5 | 6 | public class RuntimeStaticMeshImporter : ModuleRules 7 | { 8 | private string ModulePath 9 | { 10 | get { return ModuleDirectory; } 11 | } 12 | 13 | private string ThirdPartyPath 14 | { 15 | get { return Path.GetFullPath(Path.Combine(ModulePath, "../../ThirdParty/")); } 16 | } 17 | 18 | public RuntimeStaticMeshImporter(ReadOnlyTargetRules Target) : base(Target) 19 | { 20 | PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; 21 | 22 | PublicIncludePaths.AddRange( 23 | new string[] { 24 | "RuntimeStaticMeshImporter/Public", 25 | Path.Combine(ThirdPartyPath, "assimp/include") 26 | // ... add public include paths required here ... 27 | } 28 | ); 29 | 30 | PrivateIncludePaths.AddRange( 31 | new string[] { 32 | "RuntimeStaticMeshImporter/Private", 33 | // ... add other private include paths required here ... 34 | } 35 | ); 36 | 37 | 38 | PublicDependencyModuleNames.AddRange( 39 | new string[] 40 | { 41 | "Core", 42 | "CoreUObject", 43 | "Engine", 44 | "RHI", 45 | "RenderCore", 46 | "ProceduralMeshComponent" 47 | // ... add other public dependencies that you statically link with here ... 48 | } 49 | ); 50 | 51 | 52 | PrivateDependencyModuleNames.AddRange( 53 | new string[] 54 | { 55 | "Slate", 56 | "SlateCore", 57 | "UMG", 58 | "StaticMeshDescription", 59 | "MeshDescription", 60 | // ... add private dependencies that you statically link with here ... 61 | } 62 | ); 63 | 64 | 65 | DynamicallyLoadedModuleNames.AddRange( 66 | new string[] 67 | { 68 | // ... add any modules that your module loads dynamically here ... 69 | } 70 | ); 71 | 72 | string PlatformString = (Target.Platform == UnrealTargetPlatform.Win64) ? "Win64" : "Win32"; 73 | PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "assimp/lib", PlatformString, "assimp-vc140-mt.lib")); 74 | 75 | RuntimeDependencies.Add(Path.Combine(ThirdPartyPath, "assimp/bin", PlatformString, "assimp-vc140-mt.dll")); 76 | 77 | //PublicDelayLoadDLLs.Add("assimp-vc140-mt.dll"); 78 | //PublicAdditionalLibraries.Add(Path.Combine(RuntimeStaticMeshImporter, "FreeImage.lib")); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/NullLogger.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2017, assimp team 6 | 7 | All rights reserved. 8 | 9 | Redistribution and use of this software in source and binary forms, 10 | with or without modification, are permitted provided that the 11 | following conditions are met: 12 | 13 | * Redistributions of source code must retain the above 14 | copyright notice, this list of conditions and the 15 | following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above 18 | copyright notice, this list of conditions and the 19 | following disclaimer in the documentation and/or other 20 | materials provided with the distribution. 21 | 22 | * Neither the name of the assimp team, nor the names of its 23 | contributors may be used to endorse or promote products 24 | derived from this software without specific prior 25 | written permission of the assimp team. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 30 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 31 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 33 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 34 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 35 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 36 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 37 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | 39 | ---------------------------------------------------------------------- 40 | */ 41 | 42 | /** @file NullLogger.hpp 43 | * @brief Dummy logger 44 | */ 45 | 46 | #ifndef INCLUDED_AI_NULLLOGGER_H 47 | #define INCLUDED_AI_NULLLOGGER_H 48 | 49 | #include "Logger.hpp" 50 | 51 | namespace Assimp { 52 | 53 | // --------------------------------------------------------------------------- 54 | /** @brief CPP-API: Empty logging implementation. 55 | * 56 | * Does nothing! Used by default if the application hasn't requested a 57 | * custom logger via #DefaultLogger::set() or #DefaultLogger::create(); */ 58 | class ASSIMP_API NullLogger 59 | : public Logger { 60 | 61 | public: 62 | 63 | /** @brief Logs a debug message */ 64 | void OnDebug(const char* message) { 65 | (void)message; //this avoids compiler warnings 66 | } 67 | 68 | /** @brief Logs an info message */ 69 | void OnInfo(const char* message) { 70 | (void)message; //this avoids compiler warnings 71 | } 72 | 73 | /** @brief Logs a warning message */ 74 | void OnWarn(const char* message) { 75 | (void)message; //this avoids compiler warnings 76 | } 77 | 78 | /** @brief Logs an error message */ 79 | void OnError(const char* message) { 80 | (void)message; //this avoids compiler warnings 81 | } 82 | 83 | /** @brief Detach a still attached stream from logger */ 84 | bool attachStream(LogStream *pStream, unsigned int severity) { 85 | (void)pStream; (void)severity; //this avoids compiler warnings 86 | return false; 87 | } 88 | 89 | /** @brief Detach a still attached stream from logger */ 90 | bool detatchStream(LogStream *pStream, unsigned int severity) { 91 | (void)pStream; (void)severity; //this avoids compiler warnings 92 | return false; 93 | } 94 | 95 | private: 96 | }; 97 | } 98 | #endif // !! AI_NULLLOGGER_H_INCLUDED 99 | -------------------------------------------------------------------------------- /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/color4.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2017, assimp team 7 | 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following 13 | conditions are met: 14 | 15 | * Redistributions of source code must retain the above 16 | copyright notice, this list of conditions and the 17 | following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the 21 | following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | 24 | * Neither the name of the assimp team, nor the names of its 25 | contributors may be used to endorse or promote products 26 | derived from this software without specific prior 27 | written permission of the assimp team. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | --------------------------------------------------------------------------- 41 | */ 42 | /** @file color4.h 43 | * @brief RGBA color structure, including operators when compiling in C++ 44 | */ 45 | #pragma once 46 | #ifndef AI_COLOR4D_H_INC 47 | #define AI_COLOR4D_H_INC 48 | 49 | #include "defs.h" 50 | 51 | #ifdef __cplusplus 52 | 53 | // ---------------------------------------------------------------------------------- 54 | /** Represents a color in Red-Green-Blue space including an 55 | * alpha component. Color values range from 0 to 1. */ 56 | // ---------------------------------------------------------------------------------- 57 | template 58 | class aiColor4t 59 | { 60 | public: 61 | aiColor4t () : r(), g(), b(), a() {} 62 | aiColor4t (TReal _r, TReal _g, TReal _b, TReal _a) 63 | : r(_r), g(_g), b(_b), a(_a) {} 64 | explicit aiColor4t (TReal _r) : r(_r), g(_r), b(_r), a(_r) {} 65 | aiColor4t (const aiColor4t& o) 66 | : r(o.r), g(o.g), b(o.b), a(o.a) {} 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/vector2.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2017, assimp team 7 | 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following 13 | conditions are met: 14 | 15 | * Redistributions of source code must retain the above 16 | copyright notice, this list of conditions and the 17 | following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the 21 | following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | 24 | * Neither the name of the assimp team, nor the names of its 25 | contributors may be used to endorse or promote products 26 | derived from this software without specific prior 27 | written permission of the assimp team. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | --------------------------------------------------------------------------- 41 | */ 42 | /** @file vector2.h 43 | * @brief 2D vector structure, including operators when compiling in C++ 44 | */ 45 | #pragma once 46 | #ifndef AI_VECTOR2D_H_INC 47 | #define AI_VECTOR2D_H_INC 48 | 49 | #ifdef __cplusplus 50 | # include 51 | #else 52 | # include 53 | #endif 54 | 55 | #include "./Compiler/pushpack1.h" 56 | #include "defs.h" 57 | 58 | // ---------------------------------------------------------------------------------- 59 | /** Represents a two-dimensional vector. 60 | */ 61 | 62 | #ifdef __cplusplus 63 | template 64 | class aiVector2t 65 | { 66 | public: 67 | 68 | aiVector2t () : x(), y() {} 69 | aiVector2t (TReal _x, TReal _y) : x(_x), y(_y) {} 70 | explicit aiVector2t (TReal _xyz) : x(_xyz), y(_xyz) {} 71 | aiVector2t (const aiVector2t& o) : x(o.x), y(o.y) {} 72 | 73 | public: 74 | 75 | void Set( TReal pX, TReal pY); 76 | TReal SquareLength() const ; 77 | TReal Length() const ; 78 | aiVector2t& Normalize(); 79 | 80 | public: 81 | 82 | const aiVector2t& operator += (const aiVector2t& o); 83 | const aiVector2t& operator -= (const aiVector2t& o); 84 | const aiVector2t& operator *= (TReal f); 85 | const aiVector2t& operator /= (TReal f); 86 | 87 | TReal operator[](unsigned int i) const; 88 | TReal& operator[](unsigned int i); 89 | 90 | bool operator== (const aiVector2t& other) const; 91 | bool operator!= (const aiVector2t& other) const; 92 | 93 | bool Equal(const aiVector2t& other, TReal epsilon = 1e-6) const; 94 | 95 | aiVector2t& operator= (TReal f); 96 | const aiVector2t SymMul(const aiVector2t& o); 97 | 98 | template 99 | operator aiVector2t () const; 100 | 101 | TReal x, y; 102 | } PACK_STRUCT; 103 | 104 | typedef aiVector2t aiVector2D; 105 | 106 | #else 107 | 108 | struct aiVector2D { 109 | ai_real x, y; 110 | }; 111 | 112 | #endif // __cplusplus 113 | 114 | #include "./Compiler/poppack1.h" 115 | 116 | #endif // AI_VECTOR2D_H_INC 117 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/DefaultIOSystem.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2017, assimp team 6 | 7 | All rights reserved. 8 | 9 | Redistribution and use of this software in source and binary forms, 10 | with or without modification, are permitted provided that the 11 | following conditions are met: 12 | 13 | * Redistributions of source code must retain the above 14 | copyright notice, this list of conditions and the 15 | following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above 18 | copyright notice, this list of conditions and the 19 | following disclaimer in the documentation and/or other 20 | materials provided with the distribution. 21 | 22 | * Neither the name of the assimp team, nor the names of its 23 | contributors may be used to endorse or promote products 24 | derived from this software without specific prior 25 | written permission of the assimp team. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 30 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 31 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 33 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 34 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 35 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 36 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 37 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | 39 | ---------------------------------------------------------------------- 40 | */ 41 | 42 | /** @file Default implementation of IOSystem using the standard C file functions */ 43 | #ifndef AI_DEFAULTIOSYSTEM_H_INC 44 | #define AI_DEFAULTIOSYSTEM_H_INC 45 | 46 | #include 47 | 48 | namespace Assimp { 49 | 50 | // --------------------------------------------------------------------------- 51 | /** Default implementation of IOSystem using the standard C file functions */ 52 | class ASSIMP_API DefaultIOSystem : public IOSystem 53 | { 54 | public: 55 | /** Constructor. */ 56 | DefaultIOSystem(); 57 | 58 | /** Destructor. */ 59 | ~DefaultIOSystem(); 60 | 61 | // ------------------------------------------------------------------- 62 | /** Tests for the existence of a file at the given path. */ 63 | bool Exists( const char* pFile) const; 64 | 65 | // ------------------------------------------------------------------- 66 | /** Returns the directory separator. */ 67 | char getOsSeparator() const; 68 | 69 | // ------------------------------------------------------------------- 70 | /** Open a new file with a given path. */ 71 | IOStream* Open( const char* pFile, const char* pMode = "rb"); 72 | 73 | // ------------------------------------------------------------------- 74 | /** Closes the given file and releases all resources associated with it. */ 75 | void Close( IOStream* pFile); 76 | 77 | // ------------------------------------------------------------------- 78 | /** Compare two paths */ 79 | bool ComparePaths (const char* one, const char* second) const; 80 | 81 | /** @brief get the file name of a full filepath 82 | * example: /tmp/archive.tar.gz -> archive.tar.gz 83 | */ 84 | static std::string fileName( const std::string &path ); 85 | 86 | /** @brief get the complete base name of a full filepath 87 | * example: /tmp/archive.tar.gz -> archive.tar 88 | */ 89 | static std::string completeBaseName( const std::string &path); 90 | 91 | /** @brief get the path of a full filepath 92 | * example: /tmp/archive.tar.gz -> /tmp/ 93 | */ 94 | static std::string absolutePath( const std::string &path); 95 | }; 96 | 97 | } //!ns Assimp 98 | 99 | #endif //AI_DEFAULTIOSYSTEM_H_INC 100 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/LogStream.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2017, assimp team 6 | 7 | All rights reserved. 8 | 9 | Redistribution and use of this software in source and binary forms, 10 | with or without modification, are permitted provided that the 11 | following conditions are met: 12 | 13 | * Redistributions of source code must retain the above 14 | copyright notice, this list of conditions and the 15 | following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above 18 | copyright notice, this list of conditions and the 19 | following disclaimer in the documentation and/or other 20 | materials provided with the distribution. 21 | 22 | * Neither the name of the assimp team, nor the names of its 23 | contributors may be used to endorse or promote products 24 | derived from this software without specific prior 25 | written permission of the assimp team. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 30 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 31 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 33 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 34 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 35 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 36 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 37 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | 39 | ---------------------------------------------------------------------- 40 | */ 41 | 42 | /** @file LogStream.hpp 43 | * @brief Abstract base class 'LogStream', representing an output log stream. 44 | */ 45 | #ifndef INCLUDED_AI_LOGSTREAM_H 46 | #define INCLUDED_AI_LOGSTREAM_H 47 | 48 | #include "types.h" 49 | 50 | namespace Assimp { 51 | 52 | class IOSystem; 53 | 54 | // ------------------------------------------------------------------------------------ 55 | /** @brief CPP-API: Abstract interface for log stream implementations. 56 | * 57 | * Several default implementations are provided, see #aiDefaultLogStream for more 58 | * details. Writing your own implementation of LogStream is just necessary if these 59 | * are not enough for your purpose. */ 60 | class ASSIMP_API LogStream 61 | #ifndef SWIG 62 | : public Intern::AllocateFromAssimpHeap 63 | #endif 64 | { 65 | protected: 66 | /** @brief Default constructor */ 67 | LogStream(); 68 | 69 | public: 70 | /** @brief Virtual destructor */ 71 | virtual ~LogStream(); 72 | 73 | // ------------------------------------------------------------------- 74 | /** @brief Overwrite this for your own output methods 75 | * 76 | * Log messages *may* consist of multiple lines and you shouldn't 77 | * expect a consistent formatting. If you want custom formatting 78 | * (e.g. generate HTML), supply a custom instance of Logger to 79 | * #DefaultLogger:set(). Usually you can *expect* that a log message 80 | * is exactly one line and terminated with a single \n character. 81 | * @param message Message to be written */ 82 | virtual void write(const char* message) = 0; 83 | 84 | // ------------------------------------------------------------------- 85 | /** @brief Creates a default log stream 86 | * @param streams Type of the default stream 87 | * @param name For aiDefaultLogStream_FILE: name of the output file 88 | * @param io For aiDefaultLogStream_FILE: IOSystem to be used to open the output 89 | * file. Pass NULL for the default implementation. 90 | * @return New LogStream instance. */ 91 | static LogStream* createDefaultStream(aiDefaultLogStream stream, 92 | const char* name = "AssimpLog.txt", 93 | IOSystem* io = NULL); 94 | 95 | }; // !class LogStream 96 | 97 | inline 98 | LogStream::LogStream() { 99 | // empty 100 | } 101 | 102 | inline 103 | LogStream::~LogStream() { 104 | // empty 105 | } 106 | 107 | // ------------------------------------------------------------------------------------ 108 | } // Namespace Assimp 109 | 110 | #endif 111 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2017, assimp team 7 | 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following 13 | conditions are met: 14 | 15 | * Redistributions of source code must retain the above 16 | copyright notice, this list of conditions and the 17 | following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the 21 | following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | 24 | * Neither the name of the assimp team, nor the names of its 25 | contributors may be used to endorse or promote products 26 | derived from this software without specific prior 27 | written permission of the assimp team. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | --------------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file version.h 44 | * @brief Functions to query the version of the Assimp runtime, check 45 | * compile flags, ... 46 | */ 47 | #pragma once 48 | #ifndef AI_VERSION_H_INC 49 | #define AI_VERSION_H_INC 50 | 51 | #include "defs.h" 52 | 53 | #ifdef __cplusplus 54 | extern "C" { 55 | #endif 56 | 57 | // --------------------------------------------------------------------------- 58 | /** @brief Returns a string with legal copyright and licensing information 59 | * about Assimp. The string may include multiple lines. 60 | * @return Pointer to static string. 61 | */ 62 | ASSIMP_API const char* aiGetLegalString (void); 63 | 64 | // --------------------------------------------------------------------------- 65 | /** @brief Returns the current minor version number of Assimp. 66 | * @return Minor version of the Assimp runtime the application was 67 | * linked/built against 68 | */ 69 | ASSIMP_API unsigned int aiGetVersionMinor (void); 70 | 71 | // --------------------------------------------------------------------------- 72 | /** @brief Returns the current major version number of Assimp. 73 | * @return Major version of the Assimp runtime the application was 74 | * linked/built against 75 | */ 76 | ASSIMP_API unsigned int aiGetVersionMajor (void); 77 | 78 | // --------------------------------------------------------------------------- 79 | /** @brief Returns the repository revision of the Assimp runtime. 80 | * @return SVN Repository revision number of the Assimp runtime the 81 | * application was linked/built against. 82 | */ 83 | ASSIMP_API unsigned int aiGetVersionRevision (void); 84 | 85 | //! Assimp was compiled as a shared object (Windows: DLL) 86 | #define ASSIMP_CFLAGS_SHARED 0x1 87 | //! Assimp was compiled against STLport 88 | #define ASSIMP_CFLAGS_STLPORT 0x2 89 | //! Assimp was compiled as a debug build 90 | #define ASSIMP_CFLAGS_DEBUG 0x4 91 | 92 | //! Assimp was compiled with ASSIMP_BUILD_BOOST_WORKAROUND defined 93 | #define ASSIMP_CFLAGS_NOBOOST 0x8 94 | //! Assimp was compiled with ASSIMP_BUILD_SINGLETHREADED defined 95 | #define ASSIMP_CFLAGS_SINGLETHREADED 0x10 96 | 97 | // --------------------------------------------------------------------------- 98 | /** @brief Returns assimp's compile flags 99 | * @return Any bitwise combination of the ASSIMP_CFLAGS_xxx constants. 100 | */ 101 | ASSIMP_API unsigned int aiGetCompileFlags (void); 102 | 103 | #ifdef __cplusplus 104 | } // end extern "C" 105 | #endif 106 | 107 | #endif // !! #ifndef AI_VERSION_H_INC 108 | 109 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/quaternion.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2017, assimp team 6 | 7 | All rights reserved. 8 | 9 | Redistribution and use of this software in source and binary forms, 10 | with or without modification, are permitted provided that the 11 | following conditions are met: 12 | 13 | * Redistributions of source code must retain the above 14 | copyright notice, this list of conditions and the 15 | following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above 18 | copyright notice, this list of conditions and the 19 | following disclaimer in the documentation and/or other 20 | materials provided with the distribution. 21 | 22 | * Neither the name of the assimp team, nor the names of its 23 | contributors may be used to endorse or promote products 24 | derived from this software without specific prior 25 | written permission of the assimp team. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 30 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 31 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 33 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 34 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 35 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 36 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 37 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | 39 | ---------------------------------------------------------------------- 40 | */ 41 | 42 | /** @file quaternion.h 43 | * @brief Quaternion structure, including operators when compiling in C++ 44 | */ 45 | #pragma once 46 | #ifndef AI_QUATERNION_H_INC 47 | #define AI_QUATERNION_H_INC 48 | 49 | #ifdef __cplusplus 50 | 51 | #include "defs.h" 52 | 53 | template class aiVector3t; 54 | template class aiMatrix3x3t; 55 | 56 | // --------------------------------------------------------------------------- 57 | /** Represents a quaternion in a 4D vector. */ 58 | template 59 | class aiQuaterniont 60 | { 61 | public: 62 | aiQuaterniont() : w(1.0), x(), y(), z() {} 63 | aiQuaterniont(TReal pw, TReal px, TReal py, TReal pz) 64 | : w(pw), x(px), y(py), z(pz) {} 65 | 66 | /** Construct from rotation matrix. Result is undefined if the matrix is not orthonormal. */ 67 | explicit aiQuaterniont( const aiMatrix3x3t& pRotMatrix); 68 | 69 | /** Construct from euler angles */ 70 | aiQuaterniont( TReal rotx, TReal roty, TReal rotz); 71 | 72 | /** Construct from an axis-angle pair */ 73 | aiQuaterniont( aiVector3t axis, TReal angle); 74 | 75 | /** Construct from a normalized quaternion stored in a vec3 */ 76 | explicit aiQuaterniont( aiVector3t normalized); 77 | 78 | /** Returns a matrix representation of the quaternion */ 79 | aiMatrix3x3t GetMatrix() const; 80 | 81 | public: 82 | 83 | bool operator== (const aiQuaterniont& o) const; 84 | bool operator!= (const aiQuaterniont& o) const; 85 | 86 | bool Equal(const aiQuaterniont& o, TReal epsilon = 1e-6) const; 87 | 88 | public: 89 | 90 | /** Normalize the quaternion */ 91 | aiQuaterniont& Normalize(); 92 | 93 | /** Compute quaternion conjugate */ 94 | aiQuaterniont& Conjugate (); 95 | 96 | /** Rotate a point by this quaternion */ 97 | aiVector3t Rotate (const aiVector3t& in); 98 | 99 | /** Multiply two quaternions */ 100 | aiQuaterniont operator* (const aiQuaterniont& two) const; 101 | 102 | public: 103 | 104 | /** Performs a spherical interpolation between two quaternions and writes the result into the third. 105 | * @param pOut Target object to received the interpolated rotation. 106 | * @param pStart Start rotation of the interpolation at factor == 0. 107 | * @param pEnd End rotation, factor == 1. 108 | * @param pFactor Interpolation factor between 0 and 1. Values outside of this range yield undefined results. 109 | */ 110 | static void Interpolate( aiQuaterniont& pOut, const aiQuaterniont& pStart, 111 | const aiQuaterniont& pEnd, TReal pFactor); 112 | 113 | public: 114 | 115 | //! w,x,y,z components of the quaternion 116 | TReal w, x, y, z; 117 | } ; 118 | 119 | typedef aiQuaterniont aiQuaternion; 120 | 121 | #else 122 | 123 | struct aiQuaternion { 124 | ai_real w, x, y, z; 125 | }; 126 | 127 | #endif 128 | 129 | #endif // AI_QUATERNION_H_INC 130 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/vector3.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2017, assimp team 7 | 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following 13 | conditions are met: 14 | 15 | * Redistributions of source code must retain the above 16 | copyright notice, this list of conditions and the 17 | following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the 21 | following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | 24 | * Neither the name of the assimp team, nor the names of its 25 | contributors may be used to endorse or promote products 26 | derived from this software without specific prior 27 | written permission of the assimp team. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | --------------------------------------------------------------------------- 41 | */ 42 | /** @file vector3.h 43 | * @brief 3D vector structure, including operators when compiling in C++ 44 | */ 45 | #pragma once 46 | #ifndef AI_VECTOR3D_H_INC 47 | #define AI_VECTOR3D_H_INC 48 | 49 | #ifdef __cplusplus 50 | # include 51 | #else 52 | # include 53 | #endif 54 | 55 | #include "defs.h" 56 | 57 | #ifdef __cplusplus 58 | 59 | template class aiMatrix3x3t; 60 | template class aiMatrix4x4t; 61 | 62 | // --------------------------------------------------------------------------- 63 | /** Represents a three-dimensional vector. */ 64 | template 65 | class aiVector3t 66 | { 67 | public: 68 | aiVector3t() : x(), y(), z() {} 69 | aiVector3t(TReal _x, TReal _y, TReal _z) : x(_x), y(_y), z(_z) {} 70 | explicit aiVector3t (TReal _xyz ) : x(_xyz), y(_xyz), z(_xyz) {} 71 | aiVector3t( const aiVector3t& o ) : x(o.x), y(o.y), z(o.z) {} 72 | 73 | public: 74 | 75 | // combined operators 76 | const aiVector3t& operator += (const aiVector3t& o); 77 | const aiVector3t& operator -= (const aiVector3t& o); 78 | const aiVector3t& operator *= (TReal f); 79 | const aiVector3t& operator /= (TReal f); 80 | 81 | // transform vector by matrix 82 | aiVector3t& operator *= (const aiMatrix3x3t& mat); 83 | aiVector3t& operator *= (const aiMatrix4x4t& mat); 84 | 85 | // access a single element 86 | TReal operator[](unsigned int i) const; 87 | TReal& operator[](unsigned int i); 88 | 89 | // comparison 90 | bool operator== (const aiVector3t& other) const; 91 | bool operator!= (const aiVector3t& other) const; 92 | bool operator < (const aiVector3t& other) const; 93 | 94 | bool Equal(const aiVector3t& other, TReal epsilon = 1e-6) const; 95 | 96 | template 97 | operator aiVector3t () const; 98 | 99 | public: 100 | /** @brief Set the components of a vector 101 | * @param pX X component 102 | * @param pY Y component 103 | * @param pZ Z component */ 104 | void Set( TReal pX, TReal pY, TReal pZ); 105 | 106 | /** @brief Get the squared length of the vector 107 | * @return Square length */ 108 | TReal SquareLength() const; 109 | 110 | /** @brief Get the length of the vector 111 | * @return length */ 112 | TReal Length() const; 113 | 114 | 115 | /** @brief Normalize the vector */ 116 | aiVector3t& Normalize(); 117 | 118 | /** @brief Normalize the vector with extra check for zero vectors */ 119 | aiVector3t& NormalizeSafe(); 120 | 121 | /** @brief Componentwise multiplication of two vectors 122 | * 123 | * Note that vec*vec yields the dot product. 124 | * @param o Second factor */ 125 | const aiVector3t SymMul(const aiVector3t& o); 126 | 127 | TReal x, y, z; 128 | }; 129 | 130 | 131 | typedef aiVector3t aiVector3D; 132 | 133 | #else 134 | 135 | struct aiVector3D { 136 | ai_real x, y, z; 137 | }; 138 | 139 | #endif // __cplusplus 140 | 141 | #ifdef __cplusplus 142 | 143 | #endif // __cplusplus 144 | 145 | #endif // AI_VECTOR3D_H_INC 146 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/cfileio.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2017, assimp team 7 | 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following 13 | conditions are met: 14 | 15 | * Redistributions of source code must retain the above 16 | copyright notice, this list of conditions and the 17 | following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the 21 | following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | 24 | * Neither the name of the assimp team, nor the names of its 25 | contributors may be used to endorse or promote products 26 | derived from this software without specific prior 27 | written permission of the assimp team. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | --------------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file cfileio.h 44 | * @brief Defines generic C routines to access memory-mapped files 45 | */ 46 | #pragma once 47 | #ifndef AI_FILEIO_H_INC 48 | #define AI_FILEIO_H_INC 49 | 50 | #include 51 | #ifdef __cplusplus 52 | extern "C" { 53 | #endif 54 | struct aiFileIO; 55 | struct aiFile; 56 | 57 | // aiFile callbacks 58 | typedef size_t (*aiFileWriteProc) (C_STRUCT aiFile*, const char*, size_t, size_t); 59 | typedef size_t (*aiFileReadProc) (C_STRUCT aiFile*, char*, size_t,size_t); 60 | typedef size_t (*aiFileTellProc) (C_STRUCT aiFile*); 61 | typedef void (*aiFileFlushProc) (C_STRUCT aiFile*); 62 | typedef C_ENUM aiReturn (*aiFileSeek) (C_STRUCT aiFile*, size_t, C_ENUM aiOrigin); 63 | 64 | // aiFileIO callbacks 65 | typedef C_STRUCT aiFile* (*aiFileOpenProc) (C_STRUCT aiFileIO*, const char*, const char*); 66 | typedef void (*aiFileCloseProc) (C_STRUCT aiFileIO*, C_STRUCT aiFile*); 67 | 68 | // Represents user-defined data 69 | typedef char* aiUserData; 70 | 71 | // ---------------------------------------------------------------------------------- 72 | /** @brief C-API: File system callbacks 73 | * 74 | * Provided are functions to open and close files. Supply a custom structure to 75 | * the import function. If you don't, a default implementation is used. Use custom 76 | * file systems to enable reading from other sources, such as ZIPs 77 | * or memory locations. */ 78 | struct aiFileIO 79 | { 80 | /** Function used to open a new file 81 | */ 82 | aiFileOpenProc OpenProc; 83 | 84 | /** Function used to close an existing file 85 | */ 86 | aiFileCloseProc CloseProc; 87 | 88 | /** User-defined, opaque data */ 89 | aiUserData UserData; 90 | }; 91 | 92 | // ---------------------------------------------------------------------------------- 93 | /** @brief C-API: File callbacks 94 | * 95 | * Actually, it's a data structure to wrap a set of fXXXX (e.g fopen) 96 | * replacement functions. 97 | * 98 | * The default implementation of the functions utilizes the fXXX functions from 99 | * the CRT. However, you can supply a custom implementation to Assimp by 100 | * delivering a custom aiFileIO. Use this to enable reading from other sources, 101 | * such as ZIP archives or memory locations. */ 102 | struct aiFile 103 | { 104 | /** Callback to read from a file */ 105 | aiFileReadProc ReadProc; 106 | 107 | /** Callback to write to a file */ 108 | aiFileWriteProc WriteProc; 109 | 110 | /** Callback to retrieve the current position of 111 | * the file cursor (ftell()) 112 | */ 113 | aiFileTellProc TellProc; 114 | 115 | /** Callback to retrieve the size of the file, 116 | * in bytes 117 | */ 118 | aiFileTellProc FileSizeProc; 119 | 120 | /** Callback to set the current position 121 | * of the file cursor (fseek()) 122 | */ 123 | aiFileSeek SeekProc; 124 | 125 | /** Callback to flush the file contents 126 | */ 127 | aiFileFlushProc FlushProc; 128 | 129 | /** User-defined, opaque data 130 | */ 131 | aiUserData UserData; 132 | }; 133 | 134 | #ifdef __cplusplus 135 | } 136 | #endif 137 | #endif // AI_FILEIO_H_INC 138 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/DefaultIOStream.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2017, assimp team 6 | 7 | All rights reserved. 8 | 9 | Redistribution and use of this software in source and binary forms, 10 | with or without modification, are permitted provided that the 11 | following conditions are met: 12 | 13 | * Redistributions of source code must retain the above 14 | copyright notice, this list of conditions and the 15 | following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above 18 | copyright notice, this list of conditions and the 19 | following disclaimer in the documentation and/or other 20 | materials provided with the distribution. 21 | 22 | * Neither the name of the assimp team, nor the names of its 23 | contributors may be used to endorse or promote products 24 | derived from this software without specific prior 25 | written permission of the assimp team. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 30 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 31 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 33 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 34 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 35 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 36 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 37 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | 39 | ---------------------------------------------------------------------- 40 | */ 41 | 42 | /** @file Default file I/O using fXXX()-family of functions */ 43 | #ifndef AI_DEFAULTIOSTREAM_H_INC 44 | #define AI_DEFAULTIOSTREAM_H_INC 45 | 46 | #include 47 | #include 48 | #include 49 | #include 50 | 51 | namespace Assimp { 52 | 53 | // ---------------------------------------------------------------------------------- 54 | //! @class DefaultIOStream 55 | //! @brief Default IO implementation, use standard IO operations 56 | //! @note An instance of this class can exist without a valid file handle 57 | //! attached to it. All calls fail, but the instance can nevertheless be 58 | //! used with no restrictions. 59 | class ASSIMP_API DefaultIOStream : public IOStream 60 | { 61 | friend class DefaultIOSystem; 62 | #if __ANDROID__ 63 | # if __ANDROID_API__ > 9 64 | # if defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT) 65 | friend class AndroidJNIIOSystem; 66 | # endif // defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT) 67 | # endif // __ANDROID_API__ > 9 68 | #endif // __ANDROID__ 69 | 70 | protected: 71 | DefaultIOStream(); 72 | DefaultIOStream(FILE* pFile, const std::string &strFilename); 73 | 74 | public: 75 | /** Destructor public to allow simple deletion to close the file. */ 76 | ~DefaultIOStream (); 77 | 78 | // ------------------------------------------------------------------- 79 | /// Read from stream 80 | size_t Read(void* pvBuffer, 81 | size_t pSize, 82 | size_t pCount); 83 | 84 | 85 | // ------------------------------------------------------------------- 86 | /// Write to stream 87 | size_t Write(const void* pvBuffer, 88 | size_t pSize, 89 | size_t pCount); 90 | 91 | // ------------------------------------------------------------------- 92 | /// Seek specific position 93 | aiReturn Seek(size_t pOffset, 94 | aiOrigin pOrigin); 95 | 96 | // ------------------------------------------------------------------- 97 | /// Get current seek position 98 | size_t Tell() const; 99 | 100 | // ------------------------------------------------------------------- 101 | /// Get size of file 102 | size_t FileSize() const; 103 | 104 | // ------------------------------------------------------------------- 105 | /// Flush file contents 106 | void Flush(); 107 | 108 | private: 109 | // File data-structure, using clib 110 | FILE* mFile; 111 | // Filename 112 | std::string mFilename; 113 | 114 | // Cached file size 115 | mutable size_t mCachedSize; 116 | }; 117 | 118 | // ---------------------------------------------------------------------------------- 119 | inline DefaultIOStream::DefaultIOStream () : 120 | mFile (NULL), 121 | mFilename (""), 122 | mCachedSize(SIZE_MAX) 123 | { 124 | // empty 125 | } 126 | 127 | // ---------------------------------------------------------------------------------- 128 | inline DefaultIOStream::DefaultIOStream (FILE* pFile, 129 | const std::string &strFilename) : 130 | mFile(pFile), 131 | mFilename(strFilename), 132 | mCachedSize(SIZE_MAX) 133 | { 134 | // empty 135 | } 136 | // ---------------------------------------------------------------------------------- 137 | 138 | } // ns assimp 139 | 140 | #endif //!!AI_DEFAULTIOSTREAM_H_INC 141 | 142 | -------------------------------------------------------------------------------- /Source/Public/RuntimeStaticMeshImporterBFL.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "ProceduralMeshComponent.h" 7 | #include "Kismet/BlueprintFunctionLibrary.h" 8 | #include "Kismet/KismetRenderingLibrary.h" 9 | #include "Misc/Paths.h" 10 | #include "HAL/FileManagerGeneric.h" 11 | #include "Misc/FileHelper.h" 12 | #include "RuntimeStaticMeshImporterBFL.generated.h" 13 | 14 | 15 | USTRUCT(BlueprintType) struct FSTMIMeshData 16 | { 17 | GENERATED_BODY() 18 | 19 | public: 20 | 21 | FSTMIMeshData() 22 | { 23 | 24 | } 25 | 26 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Runtime Static Mesh Importer|Data") 27 | TArray Vertices; 28 | 29 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Runtime Static Mesh Importer|Data") 30 | TArray Triangles; 31 | 32 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Runtime Static Mesh Importer|Data") 33 | TArray Normals; 34 | 35 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Runtime Static Mesh Importer|Data") 36 | TArray UV0; 37 | 38 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Runtime Static Mesh Importer|Data") 39 | TArray VertexColors; 40 | 41 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Runtime Static Mesh Importer|Data") 42 | TArray Tangents; 43 | 44 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Runtime Static Mesh Importer|Data") 45 | FTransform RelativeTransform; 46 | }; 47 | 48 | USTRUCT(BlueprintType) struct FSTMIObjectData 49 | { 50 | GENERATED_BODY() 51 | 52 | public: 53 | 54 | FSTMIObjectData() 55 | { 56 | 57 | } 58 | 59 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Runtime Static Mesh Importer|Data") 60 | bool bGotMeshData; 61 | 62 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Runtime Static Mesh Importer|Data") 63 | int32 NumMeshes; 64 | 65 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Runtime Static Mesh Importer|Data") 66 | TArray MeshData; 67 | 68 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Runtime Static Mesh Importer|Data") 69 | TArray TexturePaths; 70 | 71 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Runtime Static Mesh Importer|Data") 72 | TArray Textures; 73 | }; 74 | 75 | USTRUCT(BlueprintType) struct FSTMIFilePathData 76 | { 77 | GENERATED_BODY() 78 | 79 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Runtime Static Mesh Importer|Data") 80 | FString FileName; 81 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Runtime Static Mesh Importer|Data") 82 | FString FilePath; 83 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Runtime Static Mesh Importer|Data") 84 | FString SubfolderName; 85 | UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Runtime Static Mesh Importer|Data") 86 | FString FileSubfolder; 87 | }; 88 | 89 | UCLASS() 90 | class RUNTIMESTATICMESHIMPORTER_API URuntimeStaticMeshImporterBFL : public UBlueprintFunctionLibrary 91 | { 92 | GENERATED_BODY() 93 | 94 | public: 95 | 96 | //Get all user content directories. If DirectPath is checked it will search the full path, if not it will search from a specified folder in your project's directory. Also gets any fbx data paths to easily connect with LoadFbxFile function. 97 | UFUNCTION(BlueprintCallable, Category = "Runtime Static Mesh Importer") 98 | static void GetUgcDirectoriesAndFbx(FString UGCDirectory, bool bDirectPath, bool bMakeDirectoryIfNotFound, TArray& Directories, TArray& FbxPathStructs, bool& bFoundUGCDirectory); 99 | 100 | // Loads fbx data for populating procedural mesh component sections. Will check for DirectPath first, if empty will check for FBX Path Struct. The FbxData array contains ALL meshes found in the fbx file. 101 | UFUNCTION(BlueprintCallable, Category = "Runtime Static Mesh importer") 102 | static void LoadFbxFile(FString DirectPath, FSTMIFilePathData FbxPathStruct, TArray& FbxData); 103 | 104 | //Automatically called by LoadFbxFile, but this can be used by itself as well to find the textures for a specific FBX Data struct. 105 | UFUNCTION(BlueprintCallable, Category = "Runtime Static Mesh importer") 106 | static void GetFbxTextures(FSTMIFilePathData FbxPathStruct, TArray& TexturePaths, TArray& loadedtextures); 107 | 108 | //Creates a transient ProceduralMeshComponent. This is a temporary object that isn't saved by the game, so it's important to either populate a static mesh using the data (PopulateStaticMeshFromPMC) or set your own PMC with it! If you just want to use it to setup a static mesh, then it will simply be garbage collected and you needn't worry about removing it manually. 109 | UFUNCTION(BlueprintCallable, Category = "Runtime Static Mesh importer") 110 | static void CreatePMCFromData(FSTMIObjectData FbxData, UProceduralMeshComponent*& OutMesh); 111 | //Populates a specified static mesh component using a procedural mesh component. 112 | UFUNCTION(BlueprintCallable, Category = "Runtime Static Mesh importer") 113 | static void PopulateStaticMeshFromPMC(UProceduralMeshComponent* ProceduralMesh, UStaticMeshComponent* StaticMeshComponentToPopulate); 114 | private: 115 | 116 | }; 117 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/IOStream.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2017, assimp team 7 | 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following 13 | conditions are met: 14 | 15 | * Redistributions of source code must retain the above 16 | copyright notice, this list of conditions and the 17 | following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the 21 | following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | 24 | * Neither the name of the assimp team, nor the names of its 25 | contributors may be used to endorse or promote products 26 | derived from this software without specific prior 27 | written permission of the assimp team. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | --------------------------------------------------------------------------- 41 | */ 42 | /** @file IOStream.hpp 43 | * @brief File I/O wrappers for C++. 44 | */ 45 | 46 | #pragma once 47 | #ifndef AI_IOSTREAM_H_INC 48 | #define AI_IOSTREAM_H_INC 49 | 50 | #include "types.h" 51 | 52 | #ifndef __cplusplus 53 | # error This header requires C++ to be used. aiFileIO.h is the \ 54 | corresponding C interface. 55 | #endif 56 | 57 | namespace Assimp { 58 | 59 | // ---------------------------------------------------------------------------------- 60 | /** @brief CPP-API: Class to handle file I/O for C++ 61 | * 62 | * Derive an own implementation from this interface to provide custom IO handling 63 | * to the Importer. If you implement this interface, be sure to also provide an 64 | * implementation for IOSystem that creates instances of your custom IO class. 65 | */ 66 | class ASSIMP_API IOStream 67 | #ifndef SWIG 68 | : public Intern::AllocateFromAssimpHeap 69 | #endif 70 | { 71 | protected: 72 | /** Constructor protected, use IOSystem::Open() to create an instance. */ 73 | IOStream(void); 74 | 75 | public: 76 | // ------------------------------------------------------------------- 77 | /** @brief Destructor. Deleting the object closes the underlying file, 78 | * alternatively you may use IOSystem::Close() to release the file. 79 | */ 80 | virtual ~IOStream(); 81 | 82 | // ------------------------------------------------------------------- 83 | /** @brief Read from the file 84 | * 85 | * See fread() for more details 86 | * This fails for write-only files */ 87 | virtual size_t Read(void* pvBuffer, 88 | size_t pSize, 89 | size_t pCount) = 0; 90 | 91 | // ------------------------------------------------------------------- 92 | /** @brief Write to the file 93 | * 94 | * See fwrite() for more details 95 | * This fails for read-only files */ 96 | virtual size_t Write(const void* pvBuffer, 97 | size_t pSize, 98 | size_t pCount) = 0; 99 | 100 | // ------------------------------------------------------------------- 101 | /** @brief Set the read/write cursor of the file 102 | * 103 | * Note that the offset is _negative_ for aiOrigin_END. 104 | * See fseek() for more details */ 105 | virtual aiReturn Seek(size_t pOffset, 106 | aiOrigin pOrigin) = 0; 107 | 108 | // ------------------------------------------------------------------- 109 | /** @brief Get the current position of the read/write cursor 110 | * 111 | * See ftell() for more details */ 112 | virtual size_t Tell() const = 0; 113 | 114 | // ------------------------------------------------------------------- 115 | /** @brief Returns filesize 116 | * Returns the filesize. */ 117 | virtual size_t FileSize() const = 0; 118 | 119 | // ------------------------------------------------------------------- 120 | /** @brief Flush the contents of the file buffer (for writers) 121 | * See fflush() for more details. 122 | */ 123 | virtual void Flush() = 0; 124 | }; //! class IOStream 125 | 126 | // ---------------------------------------------------------------------------------- 127 | inline IOStream::IOStream() 128 | { 129 | // empty 130 | } 131 | 132 | // ---------------------------------------------------------------------------------- 133 | inline IOStream::~IOStream() 134 | { 135 | // empty 136 | } 137 | // ---------------------------------------------------------------------------------- 138 | } //!namespace Assimp 139 | 140 | #endif //!!AI_IOSTREAM_H_INC 141 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/ProgressHandler.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2017, assimp team 6 | 7 | All rights reserved. 8 | 9 | Redistribution and use of this software in source and binary forms, 10 | with or without modification, are permitted provided that the 11 | following conditions are met: 12 | 13 | * Redistributions of source code must retain the above 14 | copyright notice, this list of conditions and the 15 | following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above 18 | copyright notice, this list of conditions and the 19 | following disclaimer in the documentation and/or other 20 | materials provided with the distribution. 21 | 22 | * Neither the name of the assimp team, nor the names of its 23 | contributors may be used to endorse or promote products 24 | derived from this software without specific prior 25 | written permission of the assimp team. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 30 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 31 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 33 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 34 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 35 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 36 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 37 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | 39 | ---------------------------------------------------------------------- 40 | */ 41 | 42 | /** @file ProgressHandler.hpp 43 | * @brief Abstract base class 'ProgressHandler'. 44 | */ 45 | #pragma once 46 | #ifndef AI_PROGRESSHANDLER_H_INC 47 | #define AI_PROGRESSHANDLER_H_INC 48 | 49 | #include "types.h" 50 | 51 | namespace Assimp { 52 | 53 | // ------------------------------------------------------------------------------------ 54 | /** @brief CPP-API: Abstract interface for custom progress report receivers. 55 | * 56 | * Each #Importer instance maintains its own #ProgressHandler. The default 57 | * implementation provided by Assimp doesn't do anything at all. */ 58 | class ASSIMP_API ProgressHandler 59 | #ifndef SWIG 60 | : public Intern::AllocateFromAssimpHeap 61 | #endif 62 | { 63 | protected: 64 | /** @brief Default constructor */ 65 | ProgressHandler () { 66 | } 67 | public: 68 | /** @brief Virtual destructor */ 69 | virtual ~ProgressHandler () { 70 | } 71 | 72 | // ------------------------------------------------------------------- 73 | /** @brief Progress callback. 74 | * @param percentage An estimate of the current loading progress, 75 | * in percent. Or -1.f if such an estimate is not available. 76 | * 77 | * There are restriction on what you may do from within your 78 | * implementation of this method: no exceptions may be thrown and no 79 | * non-const #Importer methods may be called. It is 80 | * not generally possible to predict the number of callbacks 81 | * fired during a single import. 82 | * 83 | * @return Return false to abort loading at the next possible 84 | * occasion (loaders and Assimp are generally allowed to perform 85 | * all needed cleanup tasks prior to returning control to the 86 | * caller). If the loading is aborted, #Importer::ReadFile() 87 | * returns always NULL. 88 | * */ 89 | virtual bool Update(float percentage = -1.f) = 0; 90 | 91 | // ------------------------------------------------------------------- 92 | /** @brief Progress callback for file loading steps 93 | * @param numberOfSteps The number of total post-processing 94 | * steps 95 | * @param currentStep The index of the current post-processing 96 | * step that will run, or equal to numberOfSteps if all of 97 | * them has finished. This number is always strictly monotone 98 | * increasing, although not necessarily linearly. 99 | * 100 | * @note This is currently only used at the start and the end 101 | * of the file parsing. 102 | * */ 103 | virtual void UpdateFileRead(int currentStep /*= 0*/, int numberOfSteps /*= 0*/) { 104 | float f = numberOfSteps ? currentStep / (float)numberOfSteps : 1.0f; 105 | Update( f * 0.5f ); 106 | } 107 | 108 | // ------------------------------------------------------------------- 109 | /** @brief Progress callback for post-processing steps 110 | * @param numberOfSteps The number of total post-processing 111 | * steps 112 | * @param currentStep The index of the current post-processing 113 | * step that will run, or equal to numberOfSteps if all of 114 | * them has finished. This number is always strictly monotone 115 | * increasing, although not necessarily linearly. 116 | * */ 117 | virtual void UpdatePostProcess(int currentStep /*= 0*/, int numberOfSteps /*= 0*/) { 118 | float f = numberOfSteps ? currentStep / (float)numberOfSteps : 1.0f; 119 | Update( f * 0.5f + 0.5f ); 120 | } 121 | 122 | }; // !class ProgressHandler 123 | // ------------------------------------------------------------------------------------ 124 | } // Namespace Assimp 125 | 126 | #endif // AI_PROGRESSHANDLER_H_INC 127 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/importerdesc.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2017, assimp team 7 | 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following 13 | conditions are met: 14 | 15 | * Redistributions of source code must retain the above 16 | copyright notice, this list of conditions and the 17 | following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the 21 | following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | 24 | * Neither the name of the assimp team, nor the names of its 25 | contributors may be used to endorse or promote products 26 | derived from this software without specific prior 27 | written permission of the assimp team. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | --------------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file importerdesc.h 44 | * @brief #aiImporterFlags, aiImporterDesc implementation. 45 | */ 46 | #pragma once 47 | #ifndef AI_IMPORTER_DESC_H_INC 48 | #define AI_IMPORTER_DESC_H_INC 49 | 50 | 51 | /** Mixed set of flags for #aiImporterDesc, indicating some features 52 | * common to many importers*/ 53 | enum aiImporterFlags 54 | { 55 | /** Indicates that there is a textual encoding of the 56 | * file format; and that it is supported.*/ 57 | aiImporterFlags_SupportTextFlavour = 0x1, 58 | 59 | /** Indicates that there is a binary encoding of the 60 | * file format; and that it is supported.*/ 61 | aiImporterFlags_SupportBinaryFlavour = 0x2, 62 | 63 | /** Indicates that there is a compressed encoding of the 64 | * file format; and that it is supported.*/ 65 | aiImporterFlags_SupportCompressedFlavour = 0x4, 66 | 67 | /** Indicates that the importer reads only a very particular 68 | * subset of the file format. This happens commonly for 69 | * declarative or procedural formats which cannot easily 70 | * be mapped to #aiScene */ 71 | aiImporterFlags_LimitedSupport = 0x8, 72 | 73 | /** Indicates that the importer is highly experimental and 74 | * should be used with care. This only happens for trunk 75 | * (i.e. SVN) versions, experimental code is not included 76 | * in releases. */ 77 | aiImporterFlags_Experimental = 0x10 78 | }; 79 | 80 | 81 | /** Meta information about a particular importer. Importers need to fill 82 | * this structure, but they can freely decide how talkative they are. 83 | * A common use case for loader meta info is a user interface 84 | * in which the user can choose between various import/export file 85 | * formats. Building such an UI by hand means a lot of maintenance 86 | * as importers/exporters are added to Assimp, so it might be useful 87 | * to have a common mechanism to query some rough importer 88 | * characteristics. */ 89 | struct aiImporterDesc 90 | { 91 | /** Full name of the importer (i.e. Blender3D importer)*/ 92 | const char* mName; 93 | 94 | /** Original author (left blank if unknown or whole assimp team) */ 95 | const char* mAuthor; 96 | 97 | /** Current maintainer, left blank if the author maintains */ 98 | const char* mMaintainer; 99 | 100 | /** Implementation comments, i.e. unimplemented features*/ 101 | const char* mComments; 102 | 103 | /** These flags indicate some characteristics common to many 104 | importers. */ 105 | unsigned int mFlags; 106 | 107 | /** Minimum format version that can be loaded im major.minor format, 108 | both are set to 0 if there is either no version scheme 109 | or if the loader doesn't care. */ 110 | unsigned int mMinMajor; 111 | unsigned int mMinMinor; 112 | 113 | /** Maximum format version that can be loaded im major.minor format, 114 | both are set to 0 if there is either no version scheme 115 | or if the loader doesn't care. Loaders that expect to be 116 | forward-compatible to potential future format versions should 117 | indicate zero, otherwise they should specify the current 118 | maximum version.*/ 119 | unsigned int mMaxMajor; 120 | unsigned int mMaxMinor; 121 | 122 | /** List of file extensions this importer can handle. 123 | List entries are separated by space characters. 124 | All entries are lower case without a leading dot (i.e. 125 | "xml dae" would be a valid value. Note that multiple 126 | importers may respond to the same file extension - 127 | assimp calls all importers in the order in which they 128 | are registered and each importer gets the opportunity 129 | to load the file until one importer "claims" the file. Apart 130 | from file extension checks, importers typically use 131 | other methods to quickly reject files (i.e. magic 132 | words) so this does not mean that common or generic 133 | file extensions such as XML would be tediously slow. */ 134 | const char* mFileExtensions; 135 | }; 136 | 137 | /** \brief Returns the Importer description for a given extension. 138 | 139 | Will return a NULL-pointer if no assigned importer desc. was found for the given extension 140 | \param extension [in] The extension to look for 141 | \return A pointer showing to the ImporterDesc, \see aiImporterDesc. 142 | */ 143 | ASSIMP_API const C_STRUCT aiImporterDesc* aiGetImporterDesc( const char *extension ); 144 | 145 | #endif // AI_IMPORTER_DESC_H_INC 146 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/matrix3x3.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2017, assimp team 7 | 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following 13 | conditions are met: 14 | 15 | * Redistributions of source code must retain the above 16 | copyright notice, this list of conditions and the 17 | following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the 21 | following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | 24 | * Neither the name of the assimp team, nor the names of its 25 | contributors may be used to endorse or promote products 26 | derived from this software without specific prior 27 | written permission of the assimp team. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | --------------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file matrix3x3.h 44 | * @brief Definition of a 3x3 matrix, including operators when compiling in C++ 45 | */ 46 | #pragma once 47 | #ifndef AI_MATRIX3X3_H_INC 48 | #define AI_MATRIX3X3_H_INC 49 | 50 | #include "defs.h" 51 | 52 | #ifdef __cplusplus 53 | 54 | template class aiMatrix4x4t; 55 | template class aiVector2t; 56 | 57 | // --------------------------------------------------------------------------- 58 | /** @brief Represents a row-major 3x3 matrix 59 | * 60 | * There's much confusion about matrix layouts (column vs. row order). 61 | * This is *always* a row-major matrix. Not even with the 62 | * #aiProcess_ConvertToLeftHanded flag, which absolutely does not affect 63 | * matrix order - it just affects the handedness of the coordinate system 64 | * defined thereby. 65 | */ 66 | template 67 | class aiMatrix3x3t 68 | { 69 | public: 70 | 71 | aiMatrix3x3t () : 72 | a1(static_cast(1.0f)), a2(), a3(), 73 | b1(), b2(static_cast(1.0f)), b3(), 74 | c1(), c2(), c3(static_cast(1.0f)) {} 75 | 76 | aiMatrix3x3t ( TReal _a1, TReal _a2, TReal _a3, 77 | TReal _b1, TReal _b2, TReal _b3, 78 | TReal _c1, TReal _c2, TReal _c3) : 79 | a1(_a1), a2(_a2), a3(_a3), 80 | b1(_b1), b2(_b2), b3(_b3), 81 | c1(_c1), c2(_c2), c3(_c3) 82 | {} 83 | 84 | public: 85 | 86 | // matrix multiplication. 87 | aiMatrix3x3t& operator *= (const aiMatrix3x3t& m); 88 | aiMatrix3x3t operator * (const aiMatrix3x3t& m) const; 89 | 90 | // array access operators 91 | TReal* operator[] (unsigned int p_iIndex); 92 | const TReal* operator[] (unsigned int p_iIndex) const; 93 | 94 | // comparison operators 95 | bool operator== (const aiMatrix4x4t& m) const; 96 | bool operator!= (const aiMatrix4x4t& m) const; 97 | 98 | bool Equal(const aiMatrix4x4t& m, TReal epsilon = 1e-6) const; 99 | 100 | template 101 | operator aiMatrix3x3t () const; 102 | 103 | public: 104 | 105 | // ------------------------------------------------------------------- 106 | /** @brief Construction from a 4x4 matrix. The remaining parts 107 | * of the matrix are ignored. 108 | */ 109 | explicit aiMatrix3x3t( const aiMatrix4x4t& pMatrix); 110 | 111 | // ------------------------------------------------------------------- 112 | /** @brief Transpose the matrix 113 | */ 114 | aiMatrix3x3t& Transpose(); 115 | 116 | // ------------------------------------------------------------------- 117 | /** @brief Invert the matrix. 118 | * If the matrix is not invertible all elements are set to qnan. 119 | * Beware, use (f != f) to check whether a TReal f is qnan. 120 | */ 121 | aiMatrix3x3t& Inverse(); 122 | TReal Determinant() const; 123 | 124 | public: 125 | // ------------------------------------------------------------------- 126 | /** @brief Returns a rotation matrix for a rotation around z 127 | * @param a Rotation angle, in radians 128 | * @param out Receives the output matrix 129 | * @return Reference to the output matrix 130 | */ 131 | static aiMatrix3x3t& RotationZ(TReal a, aiMatrix3x3t& out); 132 | 133 | // ------------------------------------------------------------------- 134 | /** @brief Returns a rotation matrix for a rotation around 135 | * an arbitrary axis. 136 | * 137 | * @param a Rotation angle, in radians 138 | * @param axis Axis to rotate around 139 | * @param out To be filled 140 | */ 141 | static aiMatrix3x3t& Rotation( TReal a, 142 | const aiVector3t& axis, aiMatrix3x3t& out); 143 | 144 | // ------------------------------------------------------------------- 145 | /** @brief Returns a translation matrix 146 | * @param v Translation vector 147 | * @param out Receives the output matrix 148 | * @return Reference to the output matrix 149 | */ 150 | static aiMatrix3x3t& Translation( const aiVector2t& v, aiMatrix3x3t& out); 151 | 152 | // ------------------------------------------------------------------- 153 | /** @brief A function for creating a rotation matrix that rotates a 154 | * vector called "from" into another vector called "to". 155 | * Input : from[3], to[3] which both must be *normalized* non-zero vectors 156 | * Output: mtx[3][3] -- a 3x3 matrix in column-major form 157 | * Authors: Tomas Möller, John Hughes 158 | * "Efficiently Building a Matrix to Rotate One Vector to Another" 159 | * Journal of Graphics Tools, 4(4):1-4, 1999 160 | */ 161 | static aiMatrix3x3t& FromToMatrix(const aiVector3t& from, 162 | const aiVector3t& to, aiMatrix3x3t& out); 163 | 164 | public: 165 | TReal a1, a2, a3; 166 | TReal b1, b2, b3; 167 | TReal c1, c2, c3; 168 | }; 169 | 170 | typedef aiMatrix3x3t aiMatrix3x3; 171 | 172 | #else 173 | 174 | struct aiMatrix3x3 { 175 | ai_real a1, a2, a3; 176 | ai_real b1, b2, b3; 177 | ai_real c1, c2, c3; 178 | }; 179 | 180 | #endif // __cplusplus 181 | 182 | #endif // AI_MATRIX3X3_H_INC 183 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Creative Commons Legal Code 2 | 3 | CC0 1.0 Universal 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN 7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS 10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM 11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED 12 | HEREUNDER. 13 | 14 | Statement of Purpose 15 | 16 | The laws of most jurisdictions throughout the world automatically confer 17 | exclusive Copyright and Related Rights (defined below) upon the creator 18 | and subsequent owner(s) (each and all, an "owner") of an original work of 19 | authorship and/or a database (each, a "Work"). 20 | 21 | Certain owners wish to permanently relinquish those rights to a Work for 22 | the purpose of contributing to a commons of creative, cultural and 23 | scientific works ("Commons") that the public can reliably and without fear 24 | of later claims of infringement build upon, modify, incorporate in other 25 | works, reuse and redistribute as freely as possible in any form whatsoever 26 | and for any purposes, including without limitation commercial purposes. 27 | These owners may contribute to the Commons to promote the ideal of a free 28 | culture and the further production of creative, cultural and scientific 29 | works, or to gain reputation or greater distribution for their Work in 30 | part through the use and efforts of others. 31 | 32 | For these and/or other purposes and motivations, and without any 33 | expectation of additional consideration or compensation, the person 34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she 35 | is an owner of Copyright and Related Rights in the Work, voluntarily 36 | elects to apply CC0 to the Work and publicly distribute the Work under its 37 | terms, with knowledge of his or her Copyright and Related Rights in the 38 | Work and the meaning and intended legal effect of CC0 on those rights. 39 | 40 | 1. Copyright and Related Rights. A Work made available under CC0 may be 41 | protected by copyright and related or neighboring rights ("Copyright and 42 | Related Rights"). Copyright and Related Rights include, but are not 43 | limited to, the following: 44 | 45 | i. the right to reproduce, adapt, distribute, perform, display, 46 | communicate, and translate a Work; 47 | ii. moral rights retained by the original author(s) and/or performer(s); 48 | iii. publicity and privacy rights pertaining to a person's image or 49 | likeness depicted in a Work; 50 | iv. rights protecting against unfair competition in regards to a Work, 51 | subject to the limitations in paragraph 4(a), below; 52 | v. rights protecting the extraction, dissemination, use and reuse of data 53 | in a Work; 54 | vi. database rights (such as those arising under Directive 96/9/EC of the 55 | European Parliament and of the Council of 11 March 1996 on the legal 56 | protection of databases, and under any national implementation 57 | thereof, including any amended or successor version of such 58 | directive); and 59 | vii. other similar, equivalent or corresponding rights throughout the 60 | world based on applicable law or treaty, and any national 61 | implementations thereof. 62 | 63 | 2. Waiver. To the greatest extent permitted by, but not in contravention 64 | of, applicable law, Affirmer hereby overtly, fully, permanently, 65 | irrevocably and unconditionally waives, abandons, and surrenders all of 66 | Affirmer's Copyright and Related Rights and associated claims and causes 67 | of action, whether now known or unknown (including existing as well as 68 | future claims and causes of action), in the Work (i) in all territories 69 | worldwide, (ii) for the maximum duration provided by applicable law or 70 | treaty (including future time extensions), (iii) in any current or future 71 | medium and for any number of copies, and (iv) for any purpose whatsoever, 72 | including without limitation commercial, advertising or promotional 73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each 74 | member of the public at large and to the detriment of Affirmer's heirs and 75 | successors, fully intending that such Waiver shall not be subject to 76 | revocation, rescission, cancellation, termination, or any other legal or 77 | equitable action to disrupt the quiet enjoyment of the Work by the public 78 | as contemplated by Affirmer's express Statement of Purpose. 79 | 80 | 3. Public License Fallback. Should any part of the Waiver for any reason 81 | be judged legally invalid or ineffective under applicable law, then the 82 | Waiver shall be preserved to the maximum extent permitted taking into 83 | account Affirmer's express Statement of Purpose. In addition, to the 84 | extent the Waiver is so judged Affirmer hereby grants to each affected 85 | person a royalty-free, non transferable, non sublicensable, non exclusive, 86 | irrevocable and unconditional license to exercise Affirmer's Copyright and 87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the 88 | maximum duration provided by applicable law or treaty (including future 89 | time extensions), (iii) in any current or future medium and for any number 90 | of copies, and (iv) for any purpose whatsoever, including without 91 | limitation commercial, advertising or promotional purposes (the 92 | "License"). The License shall be deemed effective as of the date CC0 was 93 | applied by Affirmer to the Work. Should any part of the License for any 94 | reason be judged legally invalid or ineffective under applicable law, such 95 | partial invalidity or ineffectiveness shall not invalidate the remainder 96 | of the License, and in such case Affirmer hereby affirms that he or she 97 | will not (i) exercise any of his or her remaining Copyright and Related 98 | Rights in the Work or (ii) assert any associated claims and causes of 99 | action with respect to the Work, in either case contrary to Affirmer's 100 | express Statement of Purpose. 101 | 102 | 4. Limitations and Disclaimers. 103 | 104 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 105 | surrendered, licensed or otherwise affected by this document. 106 | b. Affirmer offers the Work as-is and makes no representations or 107 | warranties of any kind concerning the Work, express, implied, 108 | statutory or otherwise, including without limitation warranties of 109 | title, merchantability, fitness for a particular purpose, non 110 | infringement, or the absence of latent or other defects, accuracy, or 111 | the present or absence of errors, whether or not discoverable, all to 112 | the greatest extent permissible under applicable law. 113 | c. Affirmer disclaims responsibility for clearing rights of other persons 114 | that may apply to the Work or any use thereof, including without 115 | limitation any person's Copyright and Related Rights in the Work. 116 | Further, Affirmer disclaims responsibility for obtaining any necessary 117 | consents, permissions or other rights required for any use of the 118 | Work. 119 | d. Affirmer understands and acknowledges that Creative Commons is not a 120 | party to this document and has no duty or obligation with respect to 121 | this CC0 or use of the Work. 122 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/DefaultLogger.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2017, assimp team 6 | 7 | All rights reserved. 8 | 9 | Redistribution and use of this software in source and binary forms, 10 | with or without modification, are permitted provided that the 11 | following conditions are met: 12 | 13 | * Redistributions of source code must retain the above 14 | copyright notice, this list of conditions and the 15 | following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above 18 | copyright notice, this list of conditions and the 19 | following disclaimer in the documentation and/or other 20 | materials provided with the distribution. 21 | 22 | * Neither the name of the assimp team, nor the names of its 23 | contributors may be used to endorse or promote products 24 | derived from this software without specific prior 25 | written permission of the assimp team. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 30 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 31 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 33 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 34 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 35 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 36 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 37 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | 39 | ---------------------------------------------------------------------- 40 | */ 41 | /** @file DefaultLogger.hpp 42 | */ 43 | 44 | #ifndef INCLUDED_AI_DEFAULTLOGGER 45 | #define INCLUDED_AI_DEFAULTLOGGER 46 | 47 | #include "Logger.hpp" 48 | #include "LogStream.hpp" 49 | #include "NullLogger.hpp" 50 | #include 51 | 52 | namespace Assimp { 53 | // ------------------------------------------------------------------------------------ 54 | class IOStream; 55 | struct LogStreamInfo; 56 | 57 | /** default name of logfile */ 58 | #define ASSIMP_DEFAULT_LOG_NAME "AssimpLog.txt" 59 | 60 | // ------------------------------------------------------------------------------------ 61 | /** @brief CPP-API: Primary logging facility of Assimp. 62 | * 63 | * The library stores its primary #Logger as a static member of this class. 64 | * #get() returns this primary logger. By default the underlying implementation is 65 | * just a #NullLogger which rejects all log messages. By calling #create(), logging 66 | * is turned on. To capture the log output multiple log streams (#LogStream) can be 67 | * attach to the logger. Some default streams for common streaming locations (such as 68 | * a file, std::cout, OutputDebugString()) are also provided. 69 | * 70 | * If you wish to customize the logging at an even deeper level supply your own 71 | * implementation of #Logger to #set(). 72 | * @note The whole logging stuff causes a small extra overhead for all imports. */ 73 | class ASSIMP_API DefaultLogger : 74 | public Logger { 75 | 76 | public: 77 | 78 | // ---------------------------------------------------------------------- 79 | /** @brief Creates a logging instance. 80 | * @param name Name for log file. Only valid in combination 81 | * with the aiDefaultLogStream_FILE flag. 82 | * @param severity Log severity, VERBOSE turns on debug messages 83 | * @param defStreams Default log streams to be attached. Any bitwise 84 | * combination of the aiDefaultLogStream enumerated values. 85 | * If #aiDefaultLogStream_FILE is specified but an empty string is 86 | * passed for 'name', no log file is created at all. 87 | * @param io IOSystem to be used to open external files (such as the 88 | * log file). Pass NULL to rely on the default implementation. 89 | * This replaces the default #NullLogger with a #DefaultLogger instance. */ 90 | static Logger *create(const char* name = ASSIMP_DEFAULT_LOG_NAME, 91 | LogSeverity severity = NORMAL, 92 | unsigned int defStreams = aiDefaultLogStream_DEBUGGER | aiDefaultLogStream_FILE, 93 | IOSystem* io = NULL); 94 | 95 | // ---------------------------------------------------------------------- 96 | /** @brief Setup a custom #Logger implementation. 97 | * 98 | * Use this if the provided #DefaultLogger class doesn't fit into 99 | * your needs. If the provided message formatting is OK for you, 100 | * it's much easier to use #create() and to attach your own custom 101 | * output streams to it. 102 | * @param logger Pass NULL to setup a default NullLogger*/ 103 | static void set (Logger *logger); 104 | 105 | // ---------------------------------------------------------------------- 106 | /** @brief Getter for singleton instance 107 | * @return Only instance. This is never null, but it could be a 108 | * NullLogger. Use isNullLogger to check this.*/ 109 | static Logger *get(); 110 | 111 | // ---------------------------------------------------------------------- 112 | /** @brief Return whether a #NullLogger is currently active 113 | * @return true if the current logger is a #NullLogger. 114 | * Use create() or set() to setup a logger that does actually do 115 | * something else than just rejecting all log messages. */ 116 | static bool isNullLogger(); 117 | 118 | // ---------------------------------------------------------------------- 119 | /** @brief Kills the current singleton logger and replaces it with a 120 | * #NullLogger instance. */ 121 | static void kill(); 122 | 123 | // ---------------------------------------------------------------------- 124 | /** @copydoc Logger::attachStream */ 125 | bool attachStream(LogStream *pStream, 126 | unsigned int severity); 127 | 128 | // ---------------------------------------------------------------------- 129 | /** @copydoc Logger::detatchStream */ 130 | bool detatchStream(LogStream *pStream, 131 | unsigned int severity); 132 | 133 | 134 | private: 135 | 136 | // ---------------------------------------------------------------------- 137 | /** @briefPrivate construction for internal use by create(). 138 | * @param severity Logging granularity */ 139 | explicit DefaultLogger(LogSeverity severity); 140 | 141 | // ---------------------------------------------------------------------- 142 | /** @briefDestructor */ 143 | ~DefaultLogger(); 144 | 145 | private: 146 | 147 | /** @brief Logs debug infos, only been written when severity level VERBOSE is set */ 148 | void OnDebug(const char* message); 149 | 150 | /** @brief Logs an info message */ 151 | void OnInfo(const char* message); 152 | 153 | /** @brief Logs a warning message */ 154 | void OnWarn(const char* message); 155 | 156 | /** @brief Logs an error message */ 157 | void OnError(const char* message); 158 | 159 | // ---------------------------------------------------------------------- 160 | /** @brief Writes a message to all streams */ 161 | void WriteToStreams(const char* message, ErrorSeverity ErrorSev ); 162 | 163 | // ---------------------------------------------------------------------- 164 | /** @brief Returns the thread id. 165 | * @note This is an OS specific feature, if not supported, a 166 | * zero will be returned. 167 | */ 168 | unsigned int GetThreadID(); 169 | 170 | private: 171 | // Aliases for stream container 172 | typedef std::vector StreamArray; 173 | typedef std::vector::iterator StreamIt; 174 | typedef std::vector::const_iterator ConstStreamIt; 175 | 176 | //! only logging instance 177 | static Logger *m_pLogger; 178 | static NullLogger s_pNullLogger; 179 | 180 | //! Attached streams 181 | StreamArray m_StreamArray; 182 | 183 | bool noRepeatMsg; 184 | char lastMsg[MAX_LOG_MESSAGE_LENGTH*2]; 185 | size_t lastLen; 186 | }; 187 | // ------------------------------------------------------------------------------------ 188 | 189 | } // Namespace Assimp 190 | 191 | #endif // !! INCLUDED_AI_DEFAULTLOGGER 192 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/texture.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2017, assimp team 7 | 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following 13 | conditions are met: 14 | 15 | * Redistributions of source code must retain the above 16 | copyright notice, this list of conditions and the 17 | following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the 21 | following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | 24 | * Neither the name of the assimp team, nor the names of its 25 | contributors may be used to endorse or promote products 26 | derived from this software without specific prior 27 | written permission of the assimp team. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | --------------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file texture.h 44 | * @brief Defines texture helper structures for the library 45 | * 46 | * Used for file formats which embed their textures into the model file. 47 | * Supported are both normal textures, which are stored as uncompressed 48 | * pixels, and "compressed" textures, which are stored in a file format 49 | * such as PNG or TGA. 50 | */ 51 | #pragma once 52 | #ifndef AI_TEXTURE_H_INC 53 | #define AI_TEXTURE_H_INC 54 | 55 | #include "types.h" 56 | 57 | #ifdef __cplusplus 58 | extern "C" { 59 | #endif 60 | 61 | 62 | // -------------------------------------------------------------------------------- 63 | 64 | /** \def AI_EMBEDDED_TEXNAME_PREFIX 65 | * \ref AI_MAKE_EMBEDDED_TEXNAME 66 | */ 67 | #ifndef AI_EMBEDDED_TEXNAME_PREFIX 68 | # define AI_EMBEDDED_TEXNAME_PREFIX "*" 69 | #endif 70 | 71 | /** @def AI_MAKE_EMBEDDED_TEXNAME 72 | * Used to build the reserved path name used by the material system to 73 | * reference textures that are embedded into their corresponding 74 | * model files. The parameter specifies the index of the texture 75 | * (zero-based, in the aiScene::mTextures array) 76 | */ 77 | #if (!defined AI_MAKE_EMBEDDED_TEXNAME) 78 | # define AI_MAKE_EMBEDDED_TEXNAME(_n_) AI_EMBEDDED_TEXNAME_PREFIX # _n_ 79 | #endif 80 | 81 | 82 | #include "./Compiler/pushpack1.h" 83 | 84 | // -------------------------------------------------------------------------------- 85 | /** @brief Helper structure to represent a texel in a ARGB8888 format 86 | * 87 | * Used by aiTexture. 88 | */ 89 | struct aiTexel 90 | { 91 | unsigned char b,g,r,a; 92 | 93 | #ifdef __cplusplus 94 | //! Comparison operator 95 | bool operator== (const aiTexel& other) const 96 | { 97 | return b == other.b && r == other.r && 98 | g == other.g && a == other.a; 99 | } 100 | 101 | //! Inverse comparison operator 102 | bool operator!= (const aiTexel& other) const 103 | { 104 | return b != other.b || r != other.r || 105 | g != other.g || a != other.a; 106 | } 107 | 108 | //! Conversion to a floating-point 4d color 109 | operator aiColor4D() const 110 | { 111 | return aiColor4D(r/255.f,g/255.f,b/255.f,a/255.f); 112 | } 113 | #endif // __cplusplus 114 | 115 | } PACK_STRUCT; 116 | 117 | #include "./Compiler/poppack1.h" 118 | 119 | // -------------------------------------------------------------------------------- 120 | /** Helper structure to describe an embedded texture 121 | * 122 | * Normally textures are contained in external files but some file formats embed 123 | * them directly in the model file. There are two types of embedded textures: 124 | * 1. Uncompressed textures. The color data is given in an uncompressed format. 125 | * 2. Compressed textures stored in a file format like png or jpg. The raw file 126 | * bytes are given so the application must utilize an image decoder (e.g. DevIL) to 127 | * get access to the actual color data. 128 | * 129 | * Embedded textures are referenced from materials using strings like "*0", "*1", etc. 130 | * as the texture paths (a single asterisk character followed by the 131 | * zero-based index of the texture in the aiScene::mTextures array). 132 | */ 133 | struct aiTexture 134 | { 135 | /** Width of the texture, in pixels 136 | * 137 | * If mHeight is zero the texture is compressed in a format 138 | * like JPEG. In this case mWidth specifies the size of the 139 | * memory area pcData is pointing to, in bytes. 140 | */ 141 | unsigned int mWidth; 142 | 143 | /** Height of the texture, in pixels 144 | * 145 | * If this value is zero, pcData points to an compressed texture 146 | * in any format (e.g. JPEG). 147 | */ 148 | unsigned int mHeight; 149 | 150 | /** A hint from the loader to make it easier for applications 151 | * to determine the type of embedded textures. 152 | * 153 | * If mHeight != 0 this member is show how data is packed. Hint will consist of 154 | * two parts: channel order and channel bitness (count of the bits for every 155 | * color channel). For simple parsing by the viewer it's better to not omit 156 | * absent color channel and just use 0 for bitness. For example: 157 | * 1. Image contain RGBA and 8 bit per channel, achFormatHint == "rgba8888"; 158 | * 2. Image contain ARGB and 8 bit per channel, achFormatHint == "argb8888"; 159 | * 3. Image contain RGB and 5 bit for R and B channels and 6 bit for G channel, achFormatHint == "rgba5650"; 160 | * 4. One color image with B channel and 1 bit for it, achFormatHint == "rgba0010"; 161 | * If mHeight == 0 then achFormatHint is set set to '\\0\\0\\0\\0' if the loader has no additional 162 | * information about the texture file format used OR the 163 | * file extension of the format without a trailing dot. If there 164 | * are multiple file extensions for a format, the shortest 165 | * extension is chosen (JPEG maps to 'jpg', not to 'jpeg'). 166 | * E.g. 'dds\\0', 'pcx\\0', 'jpg\\0'. All characters are lower-case. 167 | * The fourth character will always be '\\0'. 168 | */ 169 | char achFormatHint[9];// 8 for string + 1 for terminator. 170 | 171 | /** Data of the texture. 172 | * 173 | * Points to an array of mWidth * mHeight aiTexel's. 174 | * The format of the texture data is always ARGB8888 to 175 | * make the implementation for user of the library as easy 176 | * as possible. If mHeight = 0 this is a pointer to a memory 177 | * buffer of size mWidth containing the compressed texture 178 | * data. Good luck, have fun! 179 | */ 180 | C_STRUCT aiTexel* pcData; 181 | 182 | #ifdef __cplusplus 183 | 184 | //! For compressed textures (mHeight == 0): compare the 185 | //! format hint against a given string. 186 | //! @param s Input string. 3 characters are maximally processed. 187 | //! Example values: "jpg", "png" 188 | //! @return true if the given string matches the format hint 189 | bool CheckFormat(const char* s) const 190 | { 191 | return (0 == ::strncmp(achFormatHint, s, sizeof(achFormatHint))); 192 | } 193 | 194 | // Construction 195 | aiTexture () 196 | : mWidth (0) 197 | , mHeight (0) 198 | , pcData (NULL) 199 | { 200 | achFormatHint[0] = achFormatHint[1] = 0; 201 | achFormatHint[2] = achFormatHint[3] = 0; 202 | } 203 | 204 | // Destruction 205 | ~aiTexture () 206 | { 207 | delete[] pcData; 208 | } 209 | #endif 210 | }; 211 | 212 | 213 | #ifdef __cplusplus 214 | } 215 | #endif 216 | 217 | #endif // AI_TEXTURE_H_INC 218 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/camera.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2017, assimp team 7 | 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following 13 | conditions are met: 14 | 15 | * Redistributions of source code must retain the above 16 | copyright notice, this list of conditions and the 17 | following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the 21 | following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | 24 | * Neither the name of the assimp team, nor the names of its 25 | contributors may be used to endorse or promote products 26 | derived from this software without specific prior 27 | written permission of the assimp team. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | --------------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file camera.h 44 | * @brief Defines the aiCamera data structure 45 | */ 46 | 47 | #pragma once 48 | #ifndef AI_CAMERA_H_INC 49 | #define AI_CAMERA_H_INC 50 | 51 | #include "types.h" 52 | 53 | #ifdef __cplusplus 54 | extern "C" { 55 | #endif 56 | 57 | // --------------------------------------------------------------------------- 58 | /** Helper structure to describe a virtual camera. 59 | * 60 | * Cameras have a representation in the node graph and can be animated. 61 | * An important aspect is that the camera itself is also part of the 62 | * scenegraph. This means, any values such as the look-at vector are not 63 | * *absolute*, they're relative to the coordinate system defined 64 | * by the node which corresponds to the camera. This allows for camera 65 | * animations. For static cameras parameters like the 'look-at' or 'up' vectors 66 | * are usually specified directly in aiCamera, but beware, they could also 67 | * be encoded in the node transformation. The following (pseudo)code sample 68 | * shows how to do it:

69 | * @code 70 | * // Get the camera matrix for a camera at a specific time 71 | * // if the node hierarchy for the camera does not contain 72 | * // at least one animated node this is a static computation 73 | * get-camera-matrix (node sceneRoot, camera cam) : matrix 74 | * { 75 | * node cnd = find-node-for-camera(cam) 76 | * matrix cmt = identity() 77 | * 78 | * // as usual - get the absolute camera transformation for this frame 79 | * for each node nd in hierarchy from sceneRoot to cnd 80 | * matrix cur 81 | * if (is-animated(nd)) 82 | * cur = eval-animation(nd) 83 | * else cur = nd->mTransformation; 84 | * cmt = mult-matrices( cmt, cur ) 85 | * end for 86 | * 87 | * // now multiply with the camera's own local transform 88 | * cam = mult-matrices (cam, get-camera-matrix(cmt) ) 89 | * } 90 | * @endcode 91 | * 92 | * @note some file formats (such as 3DS, ASE) export a "target point" - 93 | * the point the camera is looking at (it can even be animated). Assimp 94 | * writes the target point as a subnode of the camera's main node, 95 | * called ".Target". However this is just additional information 96 | * then the transformation tracks of the camera main node make the 97 | * camera already look in the right direction. 98 | * 99 | */ 100 | struct aiCamera 101 | { 102 | /** The name of the camera. 103 | * 104 | * There must be a node in the scenegraph with the same name. 105 | * This node specifies the position of the camera in the scene 106 | * hierarchy and can be animated. 107 | */ 108 | C_STRUCT aiString mName; 109 | 110 | /** Position of the camera relative to the coordinate space 111 | * defined by the corresponding node. 112 | * 113 | * The default value is 0|0|0. 114 | */ 115 | C_STRUCT aiVector3D mPosition; 116 | 117 | 118 | /** 'Up' - vector of the camera coordinate system relative to 119 | * the coordinate space defined by the corresponding node. 120 | * 121 | * The 'right' vector of the camera coordinate system is 122 | * the cross product of the up and lookAt vectors. 123 | * The default value is 0|1|0. The vector 124 | * may be normalized, but it needn't. 125 | */ 126 | C_STRUCT aiVector3D mUp; 127 | 128 | 129 | /** 'LookAt' - vector of the camera coordinate system relative to 130 | * the coordinate space defined by the corresponding node. 131 | * 132 | * This is the viewing direction of the user. 133 | * The default value is 0|0|1. The vector 134 | * may be normalized, but it needn't. 135 | */ 136 | C_STRUCT aiVector3D mLookAt; 137 | 138 | 139 | /** Half horizontal field of view angle, in radians. 140 | * 141 | * The field of view angle is the angle between the center 142 | * line of the screen and the left or right border. 143 | * The default value is 1/4PI. 144 | */ 145 | float mHorizontalFOV; 146 | 147 | /** Distance of the near clipping plane from the camera. 148 | * 149 | * The value may not be 0.f (for arithmetic reasons to prevent 150 | * a division through zero). The default value is 0.1f. 151 | */ 152 | float mClipPlaneNear; 153 | 154 | /** Distance of the far clipping plane from the camera. 155 | * 156 | * The far clipping plane must, of course, be further away than the 157 | * near clipping plane. The default value is 1000.f. The ratio 158 | * between the near and the far plane should not be too 159 | * large (between 1000-10000 should be ok) to avoid floating-point 160 | * inaccuracies which could lead to z-fighting. 161 | */ 162 | float mClipPlaneFar; 163 | 164 | 165 | /** Screen aspect ratio. 166 | * 167 | * This is the ration between the width and the height of the 168 | * screen. Typical values are 4/3, 1/2 or 1/1. This value is 169 | * 0 if the aspect ratio is not defined in the source file. 170 | * 0 is also the default value. 171 | */ 172 | float mAspect; 173 | 174 | #ifdef __cplusplus 175 | 176 | aiCamera() 177 | : mUp (0.f,1.f,0.f) 178 | , mLookAt (0.f,0.f,1.f) 179 | , mHorizontalFOV (0.25f * (float)AI_MATH_PI) 180 | , mClipPlaneNear (0.1f) 181 | , mClipPlaneFar (1000.f) 182 | , mAspect (0.f) 183 | {} 184 | 185 | /** @brief Get a *right-handed* camera matrix from me 186 | * @param out Camera matrix to be filled 187 | */ 188 | void GetCameraMatrix (aiMatrix4x4& out) const 189 | { 190 | /** todo: test ... should work, but i'm not absolutely sure */ 191 | 192 | /** We don't know whether these vectors are already normalized ...*/ 193 | aiVector3D zaxis = mLookAt; zaxis.Normalize(); 194 | aiVector3D yaxis = mUp; yaxis.Normalize(); 195 | aiVector3D xaxis = mUp^mLookAt; xaxis.Normalize(); 196 | 197 | out.a4 = -(xaxis * mPosition); 198 | out.b4 = -(yaxis * mPosition); 199 | out.c4 = -(zaxis * mPosition); 200 | 201 | out.a1 = xaxis.x; 202 | out.a2 = xaxis.y; 203 | out.a3 = xaxis.z; 204 | 205 | out.b1 = yaxis.x; 206 | out.b2 = yaxis.y; 207 | out.b3 = yaxis.z; 208 | 209 | out.c1 = zaxis.x; 210 | out.c2 = zaxis.y; 211 | out.c3 = zaxis.z; 212 | 213 | out.d1 = out.d2 = out.d3 = 0.f; 214 | out.d4 = 1.f; 215 | } 216 | 217 | #endif 218 | }; 219 | 220 | 221 | #ifdef __cplusplus 222 | } 223 | #endif 224 | 225 | #endif // AI_CAMERA_H_INC 226 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/vector2.inl: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2017, assimp team 7 | 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following 13 | conditions are met: 14 | 15 | * Redistributions of source code must retain the above 16 | copyright notice, this list of conditions and the 17 | following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the 21 | following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | 24 | * Neither the name of the assimp team, nor the names of its 25 | contributors may be used to endorse or promote products 26 | derived from this software without specific prior 27 | written permission of the assimp team. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | --------------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file vector2.inl 44 | * @brief Inline implementation of aiVector2t operators 45 | */ 46 | #pragma once 47 | #ifndef AI_VECTOR2D_INL_INC 48 | #define AI_VECTOR2D_INL_INC 49 | 50 | #ifdef __cplusplus 51 | #include "vector2.h" 52 | 53 | #include 54 | 55 | // ------------------------------------------------------------------------------------------------ 56 | template 57 | template 58 | aiVector2t::operator aiVector2t () const { 59 | return aiVector2t(static_cast(x),static_cast(y)); 60 | } 61 | // ------------------------------------------------------------------------------------------------ 62 | template 63 | void aiVector2t::Set( TReal pX, TReal pY) { 64 | x = pX; y = pY; 65 | } 66 | 67 | // ------------------------------------------------------------------------------------------------ 68 | template 69 | TReal aiVector2t::SquareLength() const { 70 | return x*x + y*y; 71 | } 72 | 73 | // ------------------------------------------------------------------------------------------------ 74 | template 75 | TReal aiVector2t::Length() const { 76 | return std::sqrt( SquareLength()); 77 | } 78 | 79 | // ------------------------------------------------------------------------------------------------ 80 | template 81 | aiVector2t& aiVector2t::Normalize() { 82 | *this /= Length(); 83 | return *this; 84 | } 85 | 86 | // ------------------------------------------------------------------------------------------------ 87 | template 88 | const aiVector2t& aiVector2t::operator += (const aiVector2t& o) { 89 | x += o.x; y += o.y; 90 | return *this; 91 | } 92 | 93 | // ------------------------------------------------------------------------------------------------ 94 | template 95 | const aiVector2t& aiVector2t::operator -= (const aiVector2t& o) { 96 | x -= o.x; y -= o.y; 97 | return *this; 98 | } 99 | 100 | // ------------------------------------------------------------------------------------------------ 101 | template 102 | const aiVector2t& aiVector2t::operator *= (TReal f) { 103 | x *= f; y *= f; 104 | return *this; 105 | } 106 | 107 | // ------------------------------------------------------------------------------------------------ 108 | template 109 | const aiVector2t& aiVector2t::operator /= (TReal f) { 110 | x /= f; y /= f; 111 | return *this; 112 | } 113 | 114 | // ------------------------------------------------------------------------------------------------ 115 | template 116 | TReal aiVector2t::operator[](unsigned int i) const { 117 | return *(&x + i); 118 | } 119 | 120 | // ------------------------------------------------------------------------------------------------ 121 | template 122 | TReal& aiVector2t::operator[](unsigned int i) { 123 | return *(&x + i); 124 | } 125 | 126 | // ------------------------------------------------------------------------------------------------ 127 | template 128 | bool aiVector2t::operator== (const aiVector2t& other) const { 129 | return x == other.x && y == other.y; 130 | } 131 | 132 | // ------------------------------------------------------------------------------------------------ 133 | template 134 | bool aiVector2t::operator!= (const aiVector2t& other) const { 135 | return x != other.x || y != other.y; 136 | } 137 | 138 | // --------------------------------------------------------------------------- 139 | template 140 | bool aiVector2t::Equal(const aiVector2t& other, TReal epsilon) const { 141 | return 142 | std::abs(x - other.x) <= epsilon && 143 | std::abs(y - other.y) <= epsilon; 144 | } 145 | 146 | // ------------------------------------------------------------------------------------------------ 147 | template 148 | aiVector2t& aiVector2t::operator= (TReal f) { 149 | x = y = f; 150 | return *this; 151 | } 152 | 153 | // ------------------------------------------------------------------------------------------------ 154 | template 155 | const aiVector2t aiVector2t::SymMul(const aiVector2t& o) { 156 | return aiVector2t(x*o.x,y*o.y); 157 | } 158 | 159 | 160 | // ------------------------------------------------------------------------------------------------ 161 | // symmetric addition 162 | template 163 | inline aiVector2t operator + (const aiVector2t& v1, const aiVector2t& v2) 164 | { 165 | return aiVector2t( v1.x + v2.x, v1.y + v2.y); 166 | } 167 | 168 | // ------------------------------------------------------------------------------------------------ 169 | // symmetric subtraction 170 | template 171 | inline aiVector2t operator - (const aiVector2t& v1, const aiVector2t& v2) 172 | { 173 | return aiVector2t( v1.x - v2.x, v1.y - v2.y); 174 | } 175 | 176 | // ------------------------------------------------------------------------------------------------ 177 | // scalar product 178 | template 179 | inline TReal operator * (const aiVector2t& v1, const aiVector2t& v2) 180 | { 181 | return v1.x*v2.x + v1.y*v2.y; 182 | } 183 | 184 | // ------------------------------------------------------------------------------------------------ 185 | // scalar multiplication 186 | template 187 | inline aiVector2t operator * ( TReal f, const aiVector2t& v) 188 | { 189 | return aiVector2t( f*v.x, f*v.y); 190 | } 191 | 192 | // ------------------------------------------------------------------------------------------------ 193 | // and the other way around 194 | template 195 | inline aiVector2t operator * ( const aiVector2t& v, TReal f) 196 | { 197 | return aiVector2t( f*v.x, f*v.y); 198 | } 199 | 200 | // ------------------------------------------------------------------------------------------------ 201 | // scalar division 202 | template 203 | inline aiVector2t operator / ( const aiVector2t& v, TReal f) 204 | { 205 | 206 | return v * (1/f); 207 | } 208 | 209 | // ------------------------------------------------------------------------------------------------ 210 | // vector division 211 | template 212 | inline aiVector2t operator / ( const aiVector2t& v, const aiVector2t& v2) 213 | { 214 | return aiVector2t(v.x / v2.x,v.y / v2.y); 215 | } 216 | 217 | // ------------------------------------------------------------------------------------------------ 218 | // vector negation 219 | template 220 | inline aiVector2t operator - ( const aiVector2t& v) 221 | { 222 | return aiVector2t( -v.x, -v.y); 223 | } 224 | 225 | #endif 226 | 227 | #endif // AI_VECTOR2D_INL_INC 228 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/color4.inl: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2017, assimp team 7 | 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following 13 | conditions are met: 14 | 15 | * Redistributions of source code must retain the above 16 | copyright notice, this list of conditions and the 17 | following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the 21 | following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | 24 | * Neither the name of the assimp team, nor the names of its 25 | contributors may be used to endorse or promote products 26 | derived from this software without specific prior 27 | written permission of the assimp team. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | --------------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file color4.inl 44 | * @brief Inline implementation of aiColor4t operators 45 | */ 46 | #pragma once 47 | #ifndef AI_COLOR4D_INL_INC 48 | #define AI_COLOR4D_INL_INC 49 | 50 | #ifdef __cplusplus 51 | #include "color4.h" 52 | 53 | // ------------------------------------------------------------------------------------------------ 54 | template 55 | AI_FORCE_INLINE const aiColor4t& aiColor4t::operator += (const aiColor4t& o) { 56 | r += o.r; g += o.g; b += o.b; a += o.a; 57 | return *this; 58 | } 59 | // ------------------------------------------------------------------------------------------------ 60 | template 61 | AI_FORCE_INLINE const aiColor4t& aiColor4t::operator -= (const aiColor4t& o) { 62 | r -= o.r; g -= o.g; b -= o.b; a -= o.a; 63 | return *this; 64 | } 65 | // ------------------------------------------------------------------------------------------------ 66 | template 67 | AI_FORCE_INLINE const aiColor4t& aiColor4t::operator *= (TReal f) { 68 | r *= f; g *= f; b *= f; a *= f; 69 | return *this; 70 | } 71 | // ------------------------------------------------------------------------------------------------ 72 | template 73 | AI_FORCE_INLINE const aiColor4t& aiColor4t::operator /= (TReal f) { 74 | r /= f; g /= f; b /= f; a /= f; 75 | return *this; 76 | } 77 | // ------------------------------------------------------------------------------------------------ 78 | template 79 | AI_FORCE_INLINE TReal aiColor4t::operator[](unsigned int i) const { 80 | switch ( i ) { 81 | case 0: 82 | return r; 83 | case 1: 84 | return g; 85 | case 2: 86 | return b; 87 | default: 88 | break; 89 | } 90 | return r; 91 | } 92 | // ------------------------------------------------------------------------------------------------ 93 | template 94 | AI_FORCE_INLINE TReal& aiColor4t::operator[](unsigned int i) { 95 | switch ( i ) { 96 | case 0: 97 | return r; 98 | case 1: 99 | return g; 100 | case 2: 101 | return b; 102 | default: 103 | break; 104 | } 105 | return r; 106 | } 107 | // ------------------------------------------------------------------------------------------------ 108 | template 109 | AI_FORCE_INLINE bool aiColor4t::operator== (const aiColor4t& other) const { 110 | return r == other.r && g == other.g && b == other.b && a == other.a; 111 | } 112 | // ------------------------------------------------------------------------------------------------ 113 | template 114 | AI_FORCE_INLINE bool aiColor4t::operator!= (const aiColor4t& other) const { 115 | return r != other.r || g != other.g || b != other.b || a != other.a; 116 | } 117 | // ------------------------------------------------------------------------------------------------ 118 | template 119 | AI_FORCE_INLINE bool aiColor4t::operator< (const aiColor4t& other) const { 120 | return r < other.r || ( 121 | r == other.r && ( 122 | g < other.g || ( 123 | g == other.g && ( 124 | b < other.b || ( 125 | b == other.b && ( 126 | a < other.a 127 | ) 128 | ) 129 | ) 130 | ) 131 | ) 132 | ); 133 | } 134 | // ------------------------------------------------------------------------------------------------ 135 | template 136 | AI_FORCE_INLINE aiColor4t operator + (const aiColor4t& v1, const aiColor4t& v2) { 137 | return aiColor4t( v1.r + v2.r, v1.g + v2.g, v1.b + v2.b, v1.a + v2.a); 138 | } 139 | // ------------------------------------------------------------------------------------------------ 140 | template 141 | AI_FORCE_INLINE aiColor4t operator - (const aiColor4t& v1, const aiColor4t& v2) { 142 | return aiColor4t( v1.r - v2.r, v1.g - v2.g, v1.b - v2.b, v1.a - v2.a); 143 | } 144 | // ------------------------------------------------------------------------------------------------ 145 | template 146 | AI_FORCE_INLINE aiColor4t operator * (const aiColor4t& v1, const aiColor4t& v2) { 147 | return aiColor4t( v1.r * v2.r, v1.g * v2.g, v1.b * v2.b, v1.a * v2.a); 148 | } 149 | // ------------------------------------------------------------------------------------------------ 150 | template 151 | AI_FORCE_INLINE aiColor4t operator / (const aiColor4t& v1, const aiColor4t& v2) { 152 | return aiColor4t( v1.r / v2.r, v1.g / v2.g, v1.b / v2.b, v1.a / v2.a); 153 | } 154 | // ------------------------------------------------------------------------------------------------ 155 | template 156 | AI_FORCE_INLINE aiColor4t operator * ( TReal f, const aiColor4t& v) { 157 | return aiColor4t( f*v.r, f*v.g, f*v.b, f*v.a); 158 | } 159 | // ------------------------------------------------------------------------------------------------ 160 | template 161 | AI_FORCE_INLINE aiColor4t operator * ( const aiColor4t& v, TReal f) { 162 | return aiColor4t( f*v.r, f*v.g, f*v.b, f*v.a); 163 | } 164 | // ------------------------------------------------------------------------------------------------ 165 | template 166 | AI_FORCE_INLINE aiColor4t operator / ( const aiColor4t& v, TReal f) { 167 | return v * (1/f); 168 | } 169 | // ------------------------------------------------------------------------------------------------ 170 | template 171 | AI_FORCE_INLINE aiColor4t operator / ( TReal f,const aiColor4t& v) { 172 | return aiColor4t(f,f,f,f)/v; 173 | } 174 | // ------------------------------------------------------------------------------------------------ 175 | template 176 | AI_FORCE_INLINE aiColor4t operator + ( const aiColor4t& v, TReal f) { 177 | return aiColor4t( f+v.r, f+v.g, f+v.b, f+v.a); 178 | } 179 | // ------------------------------------------------------------------------------------------------ 180 | template 181 | AI_FORCE_INLINE aiColor4t operator - ( const aiColor4t& v, TReal f) { 182 | return aiColor4t( v.r-f, v.g-f, v.b-f, v.a-f); 183 | } 184 | // ------------------------------------------------------------------------------------------------ 185 | template 186 | AI_FORCE_INLINE aiColor4t operator + ( TReal f, const aiColor4t& v) { 187 | return aiColor4t( f+v.r, f+v.g, f+v.b, f+v.a); 188 | } 189 | // ------------------------------------------------------------------------------------------------ 190 | template 191 | AI_FORCE_INLINE aiColor4t operator - ( TReal f, const aiColor4t& v) { 192 | return aiColor4t( f-v.r, f-v.g, f-v.b, f-v.a); 193 | } 194 | 195 | // ------------------------------------------------------------------------------------------------ 196 | template 197 | inline bool aiColor4t :: IsBlack() const { 198 | // The alpha component doesn't care here. black is black. 199 | static const TReal epsilon = 10e-3f; 200 | return std::fabs( r ) < epsilon && std::fabs( g ) < epsilon && std::fabs( b ) < epsilon; 201 | } 202 | 203 | #endif // __cplusplus 204 | #endif // AI_VECTOR3D_INL_INC 205 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/light.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2017, assimp team 7 | 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following 13 | conditions are met: 14 | 15 | * Redistributions of source code must retain the above 16 | copyright notice, this list of conditions and the 17 | following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the 21 | following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | 24 | * Neither the name of the assimp team, nor the names of its 25 | contributors may be used to endorse or promote products 26 | derived from this software without specific prior 27 | written permission of the assimp team. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | --------------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file light.h 44 | * @brief Defines the aiLight data structure 45 | */ 46 | 47 | #pragma once 48 | #ifndef AI_LIGHT_H_INC 49 | #define AI_LIGHT_H_INC 50 | 51 | #include "types.h" 52 | 53 | #ifdef __cplusplus 54 | extern "C" { 55 | #endif 56 | 57 | // --------------------------------------------------------------------------- 58 | /** Enumerates all supported types of light sources. 59 | */ 60 | enum aiLightSourceType 61 | { 62 | aiLightSource_UNDEFINED = 0x0, 63 | 64 | //! A directional light source has a well-defined direction 65 | //! but is infinitely far away. That's quite a good 66 | //! approximation for sun light. 67 | aiLightSource_DIRECTIONAL = 0x1, 68 | 69 | //! A point light source has a well-defined position 70 | //! in space but no direction - it emits light in all 71 | //! directions. A normal bulb is a point light. 72 | aiLightSource_POINT = 0x2, 73 | 74 | //! A spot light source emits light in a specific 75 | //! angle. It has a position and a direction it is pointing to. 76 | //! A good example for a spot light is a light spot in 77 | //! sport arenas. 78 | aiLightSource_SPOT = 0x3, 79 | 80 | //! The generic light level of the world, including the bounces 81 | //! of all other light sources. 82 | //! Typically, there's at most one ambient light in a scene. 83 | //! This light type doesn't have a valid position, direction, or 84 | //! other properties, just a color. 85 | aiLightSource_AMBIENT = 0x4, 86 | 87 | //! An area light is a rectangle with predefined size that uniformly 88 | //! emits light from one of its sides. The position is center of the 89 | //! rectangle and direction is its normal vector. 90 | aiLightSource_AREA = 0x5, 91 | 92 | /** This value is not used. It is just there to force the 93 | * compiler to map this enum to a 32 Bit integer. 94 | */ 95 | #ifndef SWIG 96 | _aiLightSource_Force32Bit = INT_MAX 97 | #endif 98 | }; 99 | 100 | // --------------------------------------------------------------------------- 101 | /** Helper structure to describe a light source. 102 | * 103 | * Assimp supports multiple sorts of light sources, including 104 | * directional, point and spot lights. All of them are defined with just 105 | * a single structure and distinguished by their parameters. 106 | * Note - some file formats (such as 3DS, ASE) export a "target point" - 107 | * the point a spot light is looking at (it can even be animated). Assimp 108 | * writes the target point as a subnode of a spotlights's main node, 109 | * called ".Target". However, this is just additional information 110 | * then, the transformation tracks of the main node make the 111 | * spot light already point in the right direction. 112 | */ 113 | struct aiLight 114 | { 115 | /** The name of the light source. 116 | * 117 | * There must be a node in the scenegraph with the same name. 118 | * This node specifies the position of the light in the scene 119 | * hierarchy and can be animated. 120 | */ 121 | C_STRUCT aiString mName; 122 | 123 | /** The type of the light source. 124 | * 125 | * aiLightSource_UNDEFINED is not a valid value for this member. 126 | */ 127 | C_ENUM aiLightSourceType mType; 128 | 129 | /** Position of the light source in space. Relative to the 130 | * transformation of the node corresponding to the light. 131 | * 132 | * The position is undefined for directional lights. 133 | */ 134 | C_STRUCT aiVector3D mPosition; 135 | 136 | /** Direction of the light source in space. Relative to the 137 | * transformation of the node corresponding to the light. 138 | * 139 | * The direction is undefined for point lights. The vector 140 | * may be normalized, but it needn't. 141 | */ 142 | C_STRUCT aiVector3D mDirection; 143 | 144 | /** Up direction of the light source in space. Relative to the 145 | * transformation of the node corresponding to the light. 146 | * 147 | * The direction is undefined for point lights. The vector 148 | * may be normalized, but it needn't. 149 | */ 150 | C_STRUCT aiVector3D mUp; 151 | 152 | /** Constant light attenuation factor. 153 | * 154 | * The intensity of the light source at a given distance 'd' from 155 | * the light's position is 156 | * @code 157 | * Atten = 1/( att0 + att1 * d + att2 * d*d) 158 | * @endcode 159 | * This member corresponds to the att0 variable in the equation. 160 | * Naturally undefined for directional lights. 161 | */ 162 | float mAttenuationConstant; 163 | 164 | /** Linear light attenuation factor. 165 | * 166 | * The intensity of the light source at a given distance 'd' from 167 | * the light's position is 168 | * @code 169 | * Atten = 1/( att0 + att1 * d + att2 * d*d) 170 | * @endcode 171 | * This member corresponds to the att1 variable in the equation. 172 | * Naturally undefined for directional lights. 173 | */ 174 | float mAttenuationLinear; 175 | 176 | /** Quadratic light attenuation factor. 177 | * 178 | * The intensity of the light source at a given distance 'd' from 179 | * the light's position is 180 | * @code 181 | * Atten = 1/( att0 + att1 * d + att2 * d*d) 182 | * @endcode 183 | * This member corresponds to the att2 variable in the equation. 184 | * Naturally undefined for directional lights. 185 | */ 186 | float mAttenuationQuadratic; 187 | 188 | /** Diffuse color of the light source 189 | * 190 | * The diffuse light color is multiplied with the diffuse 191 | * material color to obtain the final color that contributes 192 | * to the diffuse shading term. 193 | */ 194 | C_STRUCT aiColor3D mColorDiffuse; 195 | 196 | /** Specular color of the light source 197 | * 198 | * The specular light color is multiplied with the specular 199 | * material color to obtain the final color that contributes 200 | * to the specular shading term. 201 | */ 202 | C_STRUCT aiColor3D mColorSpecular; 203 | 204 | /** Ambient color of the light source 205 | * 206 | * The ambient light color is multiplied with the ambient 207 | * material color to obtain the final color that contributes 208 | * to the ambient shading term. Most renderers will ignore 209 | * this value it, is just a remaining of the fixed-function pipeline 210 | * that is still supported by quite many file formats. 211 | */ 212 | C_STRUCT aiColor3D mColorAmbient; 213 | 214 | /** Inner angle of a spot light's light cone. 215 | * 216 | * The spot light has maximum influence on objects inside this 217 | * angle. The angle is given in radians. It is 2PI for point 218 | * lights and undefined for directional lights. 219 | */ 220 | float mAngleInnerCone; 221 | 222 | /** Outer angle of a spot light's light cone. 223 | * 224 | * The spot light does not affect objects outside this angle. 225 | * The angle is given in radians. It is 2PI for point lights and 226 | * undefined for directional lights. The outer angle must be 227 | * greater than or equal to the inner angle. 228 | * It is assumed that the application uses a smooth 229 | * interpolation between the inner and the outer cone of the 230 | * spot light. 231 | */ 232 | float mAngleOuterCone; 233 | 234 | /** Size of area light source. */ 235 | C_STRUCT aiVector2D mSize; 236 | 237 | #ifdef __cplusplus 238 | 239 | aiLight() 240 | : mType (aiLightSource_UNDEFINED) 241 | , mAttenuationConstant (0.f) 242 | , mAttenuationLinear (1.f) 243 | , mAttenuationQuadratic (0.f) 244 | , mAngleInnerCone ((float)AI_MATH_TWO_PI) 245 | , mAngleOuterCone ((float)AI_MATH_TWO_PI) 246 | , mSize (0.f, 0.f) 247 | { 248 | } 249 | 250 | #endif 251 | }; 252 | 253 | #ifdef __cplusplus 254 | } 255 | #endif 256 | 257 | 258 | #endif // !! AI_LIGHT_H_INC 259 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/metadata.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2017, assimp team 7 | 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following 13 | conditions are met: 14 | 15 | * Redistributions of source code must retain the above 16 | copyright notice, this list of conditions and the 17 | following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the 21 | following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | 24 | * Neither the name of the assimp team, nor the names of its 25 | contributors may be used to endorse or promote products 26 | derived from this software without specific prior 27 | written permission of the assimp team. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | --------------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file metadata.h 44 | * @brief Defines the data structures for holding node meta information. 45 | */ 46 | #pragma once 47 | #ifndef AI_METADATA_H_INC 48 | #define AI_METADATA_H_INC 49 | 50 | #if defined(_MSC_VER) && (_MSC_VER <= 1500) 51 | # include "Compiler/pstdint.h" 52 | #else 53 | # include 54 | #endif 55 | 56 | // ------------------------------------------------------------------------------- 57 | /** 58 | * Enum used to distinguish data types 59 | */ 60 | // ------------------------------------------------------------------------------- 61 | typedef enum aiMetadataType { 62 | AI_BOOL = 0, 63 | AI_INT32 = 1, 64 | AI_UINT64 = 2, 65 | AI_FLOAT = 3, 66 | AI_DOUBLE = 4, 67 | AI_AISTRING = 5, 68 | AI_AIVECTOR3D = 6, 69 | 70 | #ifndef SWIG 71 | FORCE_32BIT = INT_MAX 72 | #endif 73 | } aiMetadataType; 74 | 75 | // ------------------------------------------------------------------------------- 76 | /** 77 | * Metadata entry 78 | * 79 | * The type field uniquely identifies the underlying type of the data field 80 | */ 81 | // ------------------------------------------------------------------------------- 82 | struct aiMetadataEntry { 83 | aiMetadataType mType; 84 | void* mData; 85 | }; 86 | 87 | #ifdef __cplusplus 88 | 89 | #include 90 | 91 | // ------------------------------------------------------------------------------- 92 | /** 93 | * Helper functions to get the aiType enum entry for a type 94 | */ 95 | // ------------------------------------------------------------------------------- 96 | 97 | inline aiMetadataType GetAiType( bool ) { return AI_BOOL; } 98 | inline aiMetadataType GetAiType( int32_t ) { return AI_INT32; } 99 | inline aiMetadataType GetAiType( uint64_t ) { return AI_UINT64; } 100 | inline aiMetadataType GetAiType( float ) { return AI_FLOAT; } 101 | inline aiMetadataType GetAiType( double ) { return AI_DOUBLE; } 102 | inline aiMetadataType GetAiType( const aiString & ) { return AI_AISTRING; } 103 | inline aiMetadataType GetAiType( const aiVector3D & ) { return AI_AIVECTOR3D; } 104 | 105 | #endif // __cplusplus 106 | 107 | // ------------------------------------------------------------------------------- 108 | /** 109 | * Container for holding metadata. 110 | * 111 | * Metadata is a key-value store using string keys and values. 112 | */ 113 | // ------------------------------------------------------------------------------- 114 | struct aiMetadata { 115 | /** Length of the mKeys and mValues arrays, respectively */ 116 | unsigned int mNumProperties; 117 | 118 | /** Arrays of keys, may not be NULL. Entries in this array may not be NULL as well. */ 119 | C_STRUCT aiString* mKeys; 120 | 121 | /** Arrays of values, may not be NULL. Entries in this array may be NULL if the 122 | * corresponding property key has no assigned value. */ 123 | C_STRUCT aiMetadataEntry* mValues; 124 | 125 | #ifdef __cplusplus 126 | 127 | /** 128 | * @brief The default constructor, set all members to zero by default. 129 | */ 130 | aiMetadata() 131 | : mNumProperties(0) 132 | , mKeys(NULL) 133 | , mValues(NULL) { 134 | // empty 135 | } 136 | 137 | /** 138 | * @brief The destructor. 139 | */ 140 | ~aiMetadata() { 141 | delete [] mKeys; 142 | mKeys = NULL; 143 | if (mValues) { 144 | // Delete each metadata entry 145 | for (unsigned i=0; i(data); 150 | break; 151 | case AI_INT32: 152 | delete static_cast(data); 153 | break; 154 | case AI_UINT64: 155 | delete static_cast(data); 156 | break; 157 | case AI_FLOAT: 158 | delete static_cast(data); 159 | break; 160 | case AI_DOUBLE: 161 | delete static_cast(data); 162 | break; 163 | case AI_AISTRING: 164 | delete static_cast(data); 165 | break; 166 | case AI_AIVECTOR3D: 167 | delete static_cast(data); 168 | break; 169 | #ifndef SWIG 170 | case FORCE_32BIT: 171 | #endif 172 | default: 173 | break; 174 | } 175 | } 176 | 177 | // Delete the metadata array 178 | delete [] mValues; 179 | mValues = NULL; 180 | } 181 | } 182 | 183 | /** 184 | * @brief Allocates property fields + keys. 185 | * @param numProperties Number of requested properties. 186 | */ 187 | static inline 188 | aiMetadata *Alloc( unsigned int numProperties ) { 189 | if ( 0 == numProperties ) { 190 | return nullptr; 191 | } 192 | 193 | aiMetadata *data = new aiMetadata; 194 | data->mNumProperties = numProperties; 195 | data->mKeys = new aiString[ data->mNumProperties ](); 196 | data->mValues = new aiMetadataEntry[ data->mNumProperties ](); 197 | 198 | return data; 199 | } 200 | 201 | /** 202 | * @brief Deallocates property fields + keys. 203 | */ 204 | static inline 205 | void Dealloc( aiMetadata *metadata ) { 206 | delete metadata; 207 | } 208 | 209 | template 210 | inline void Add(const std::string& key, const T& value) 211 | { 212 | aiString* new_keys = new aiString[mNumProperties + 1]; 213 | aiMetadataEntry* new_values = new aiMetadataEntry[mNumProperties + 1]; 214 | 215 | for(unsigned int i = 0; i < mNumProperties; ++i) 216 | { 217 | new_keys[i] = mKeys[i]; 218 | new_values[i] = mValues[i]; 219 | } 220 | 221 | delete mKeys; 222 | delete mValues; 223 | 224 | mKeys = new_keys; 225 | mValues = new_values; 226 | 227 | mNumProperties++; 228 | 229 | Set(mNumProperties - 1, key, value); 230 | } 231 | 232 | template 233 | inline 234 | bool Set( unsigned index, const std::string& key, const T& value ) { 235 | // In range assertion 236 | if ( index >= mNumProperties ) { 237 | return false; 238 | } 239 | 240 | // Ensure that we have a valid key. 241 | if ( key.empty() ) { 242 | return false; 243 | } 244 | 245 | // Set metadata key 246 | mKeys[index] = key; 247 | 248 | // Set metadata type 249 | mValues[index].mType = GetAiType(value); 250 | // Copy the given value to the dynamic storage 251 | mValues[index].mData = new T(value); 252 | 253 | return true; 254 | } 255 | 256 | template 257 | inline 258 | bool Get( unsigned index, T& value ) { 259 | // In range assertion 260 | if ( index >= mNumProperties ) { 261 | return false; 262 | } 263 | 264 | // Return false if the output data type does 265 | // not match the found value's data type 266 | if ( GetAiType( value ) != mValues[ index ].mType ) { 267 | return false; 268 | } 269 | 270 | // Otherwise, output the found value and 271 | // return true 272 | value = *static_cast(mValues[index].mData); 273 | 274 | return true; 275 | } 276 | 277 | template 278 | inline 279 | bool Get( const aiString& key, T& value ) { 280 | // Search for the given key 281 | for ( unsigned int i = 0; i < mNumProperties; ++i ) { 282 | if ( mKeys[ i ] == key ) { 283 | return Get( i, value ); 284 | } 285 | } 286 | return false; 287 | } 288 | 289 | template 290 | inline bool Get( const std::string& key, T& value ) { 291 | return Get(aiString(key), value); 292 | } 293 | 294 | /// Return metadata entry for analyzing it by user. 295 | /// \param [in] pIndex - index of the entry. 296 | /// \param [out] pKey - pointer to the key value. 297 | /// \param [out] pEntry - pointer to the entry: type and value. 298 | /// \return false - if pIndex is out of range, else - true. 299 | inline bool Get(size_t index, const aiString*& key, const aiMetadataEntry*& entry) { 300 | if ( index >= mNumProperties ) { 301 | return false; 302 | } 303 | 304 | key = &mKeys[index]; 305 | entry = &mValues[index]; 306 | 307 | return true; 308 | } 309 | 310 | #endif // __cplusplus 311 | 312 | }; 313 | 314 | #endif // AI_METADATA_H_INC 315 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/Logger.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2017, assimp team 6 | 7 | All rights reserved. 8 | 9 | Redistribution and use of this software in source and binary forms, 10 | with or without modification, are permitted provided that the 11 | following conditions are met: 12 | 13 | * Redistributions of source code must retain the above 14 | copyright notice, this list of conditions and the 15 | following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above 18 | copyright notice, this list of conditions and the 19 | following disclaimer in the documentation and/or other 20 | materials provided with the distribution. 21 | 22 | * Neither the name of the assimp team, nor the names of its 23 | contributors may be used to endorse or promote products 24 | derived from this software without specific prior 25 | written permission of the assimp team. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 30 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 31 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 33 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 34 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 35 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 36 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 37 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | 39 | ---------------------------------------------------------------------- 40 | */ 41 | 42 | /** @file Logger.hpp 43 | * @brief Abstract base class 'Logger', base of the logging system. 44 | */ 45 | #ifndef INCLUDED_AI_LOGGER_H 46 | #define INCLUDED_AI_LOGGER_H 47 | 48 | #include "types.h" 49 | 50 | namespace Assimp { 51 | 52 | class LogStream; 53 | 54 | // Maximum length of a log message. Longer messages are rejected. 55 | #define MAX_LOG_MESSAGE_LENGTH 1024u 56 | 57 | // ---------------------------------------------------------------------------------- 58 | /** @brief CPP-API: Abstract interface for logger implementations. 59 | * Assimp provides a default implementation and uses it for almost all 60 | * logging stuff ('DefaultLogger'). This class defines just basic logging 61 | * behaviour and is not of interest for you. Instead, take a look at #DefaultLogger. */ 62 | class ASSIMP_API Logger 63 | #ifndef SWIG 64 | : public Intern::AllocateFromAssimpHeap 65 | #endif 66 | { 67 | public: 68 | 69 | // ---------------------------------------------------------------------- 70 | /** @enum LogSeverity 71 | * @brief Log severity to describe the granularity of logging. 72 | */ 73 | enum LogSeverity 74 | { 75 | NORMAL, //!< Normal granularity of logging 76 | VERBOSE //!< Debug infos will be logged, too 77 | }; 78 | 79 | // ---------------------------------------------------------------------- 80 | /** @enum ErrorSeverity 81 | * @brief Description for severity of a log message. 82 | * 83 | * Every LogStream has a bitwise combination of these flags. 84 | * A LogStream doesn't receive any messages of a specific type 85 | * if it doesn't specify the corresponding ErrorSeverity flag. 86 | */ 87 | enum ErrorSeverity 88 | { 89 | Debugging = 1, //!< Debug log message 90 | Info = 2, //!< Info log message 91 | Warn = 4, //!< Warn log message 92 | Err = 8 //!< Error log message 93 | }; 94 | 95 | public: 96 | 97 | /** @brief Virtual destructor */ 98 | virtual ~Logger(); 99 | 100 | // ---------------------------------------------------------------------- 101 | /** @brief Writes a debug message 102 | * @param message Debug message*/ 103 | void debug(const char* message); 104 | inline void debug(const std::string &message); 105 | 106 | // ---------------------------------------------------------------------- 107 | /** @brief Writes a info message 108 | * @param message Info message*/ 109 | void info(const char* message); 110 | inline void info(const std::string &message); 111 | 112 | // ---------------------------------------------------------------------- 113 | /** @brief Writes a warning message 114 | * @param message Warn message*/ 115 | void warn(const char* message); 116 | inline void warn(const std::string &message); 117 | 118 | // ---------------------------------------------------------------------- 119 | /** @brief Writes an error message 120 | * @param message Error message*/ 121 | void error(const char* message); 122 | inline void error(const std::string &message); 123 | 124 | // ---------------------------------------------------------------------- 125 | /** @brief Set a new log severity. 126 | * @param log_severity New severity for logging*/ 127 | void setLogSeverity(LogSeverity log_severity); 128 | 129 | // ---------------------------------------------------------------------- 130 | /** @brief Get the current log severity*/ 131 | LogSeverity getLogSeverity() const; 132 | 133 | // ---------------------------------------------------------------------- 134 | /** @brief Attach a new log-stream 135 | * 136 | * The logger takes ownership of the stream and is responsible 137 | * for its destruction (which is done using ::delete when the logger 138 | * itself is destroyed). Call detachStream to detach a stream and to 139 | * gain ownership of it again. 140 | * @param pStream Log-stream to attach 141 | * @param severity Message filter, specified which types of log 142 | * messages are dispatched to the stream. Provide a bitwise 143 | * combination of the ErrorSeverity flags. 144 | * @return true if the stream has been attached, false otherwise.*/ 145 | virtual bool attachStream(LogStream *pStream, 146 | unsigned int severity = Debugging | Err | Warn | Info) = 0; 147 | 148 | // ---------------------------------------------------------------------- 149 | /** @brief Detach a still attached stream from the logger (or 150 | * modify the filter flags bits) 151 | * @param pStream Log-stream instance for detaching 152 | * @param severity Provide a bitwise combination of the ErrorSeverity 153 | * flags. This value is &~ed with the current flags of the stream, 154 | * if the result is 0 the stream is detached from the Logger and 155 | * the caller retakes the possession of the stream. 156 | * @return true if the stream has been detached, false otherwise.*/ 157 | virtual bool detatchStream(LogStream *pStream, 158 | unsigned int severity = Debugging | Err | Warn | Info) = 0; 159 | 160 | protected: 161 | 162 | /** Default constructor */ 163 | Logger(); 164 | 165 | /** Construction with a given log severity */ 166 | explicit Logger(LogSeverity severity); 167 | 168 | // ---------------------------------------------------------------------- 169 | /** @brief Called as a request to write a specific debug message 170 | * @param message Debug message. Never longer than 171 | * MAX_LOG_MESSAGE_LENGTH characters (excluding the '0'). 172 | * @note The message string is only valid until the scope of 173 | * the function is left. 174 | */ 175 | virtual void OnDebug(const char* message)= 0; 176 | 177 | // ---------------------------------------------------------------------- 178 | /** @brief Called as a request to write a specific info message 179 | * @param message Info message. Never longer than 180 | * MAX_LOG_MESSAGE_LENGTH characters (ecxluding the '0'). 181 | * @note The message string is only valid until the scope of 182 | * the function is left. 183 | */ 184 | virtual void OnInfo(const char* message) = 0; 185 | 186 | // ---------------------------------------------------------------------- 187 | /** @brief Called as a request to write a specific warn message 188 | * @param message Warn message. Never longer than 189 | * MAX_LOG_MESSAGE_LENGTH characters (exluding the '0'). 190 | * @note The message string is only valid until the scope of 191 | * the function is left. 192 | */ 193 | virtual void OnWarn(const char* essage) = 0; 194 | 195 | // ---------------------------------------------------------------------- 196 | /** @brief Called as a request to write a specific error message 197 | * @param message Error message. Never longer than 198 | * MAX_LOG_MESSAGE_LENGTH characters (exluding the '0'). 199 | * @note The message string is only valid until the scope of 200 | * the function is left. 201 | */ 202 | virtual void OnError(const char* message) = 0; 203 | 204 | protected: 205 | 206 | //! Logger severity 207 | LogSeverity m_Severity; 208 | }; 209 | 210 | // ---------------------------------------------------------------------------------- 211 | // Default constructor 212 | inline Logger::Logger() { 213 | setLogSeverity(NORMAL); 214 | } 215 | 216 | // ---------------------------------------------------------------------------------- 217 | // Virtual destructor 218 | inline Logger::~Logger() 219 | { 220 | } 221 | 222 | // ---------------------------------------------------------------------------------- 223 | // Construction with given logging severity 224 | inline Logger::Logger(LogSeverity severity) { 225 | setLogSeverity(severity); 226 | } 227 | 228 | // ---------------------------------------------------------------------------------- 229 | // Log severity setter 230 | inline void Logger::setLogSeverity(LogSeverity log_severity){ 231 | m_Severity = log_severity; 232 | } 233 | 234 | // ---------------------------------------------------------------------------------- 235 | // Log severity getter 236 | inline Logger::LogSeverity Logger::getLogSeverity() const { 237 | return m_Severity; 238 | } 239 | 240 | // ---------------------------------------------------------------------------------- 241 | inline void Logger::debug(const std::string &message) 242 | { 243 | return debug(message.c_str()); 244 | } 245 | 246 | // ---------------------------------------------------------------------------------- 247 | inline void Logger::error(const std::string &message) 248 | { 249 | return error(message.c_str()); 250 | } 251 | 252 | // ---------------------------------------------------------------------------------- 253 | inline void Logger::warn(const std::string &message) 254 | { 255 | return warn(message.c_str()); 256 | } 257 | 258 | // ---------------------------------------------------------------------------------- 259 | inline void Logger::info(const std::string &message) 260 | { 261 | return info(message.c_str()); 262 | } 263 | 264 | // ---------------------------------------------------------------------------------- 265 | 266 | } // Namespace Assimp 267 | 268 | #endif // !! INCLUDED_AI_LOGGER_H 269 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/defs.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2017, assimp team 7 | 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following 13 | conditions are met: 14 | 15 | * Redistributions of source code must retain the above 16 | copyright notice, this list of conditions and the 17 | following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the 21 | following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | 24 | * Neither the name of the assimp team, nor the names of its 25 | contributors may be used to endorse or promote products 26 | derived from this software without specific prior 27 | written permission of the assimp team. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | --------------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file defs.h 44 | * @brief Assimp build configuration setup. See the notes in the comment 45 | * blocks to find out how to customize _your_ Assimp build. 46 | */ 47 | 48 | #pragma once 49 | #ifndef AI_DEFINES_H_INC 50 | #define AI_DEFINES_H_INC 51 | 52 | #include 53 | 54 | ////////////////////////////////////////////////////////////////////////// 55 | /* Define ASSIMP_BUILD_NO_XX_IMPORTER to disable a specific 56 | * file format loader. The loader is be excluded from the 57 | * build in this case. 'XX' stands for the most common file 58 | * extension of the file format. E.g.: 59 | * ASSIMP_BUILD_NO_X_IMPORTER disables the X loader. 60 | * 61 | * If you're unsure about that, take a look at the implementation of the 62 | * import plugin you wish to disable. You'll find the right define in the 63 | * first lines of the corresponding unit. 64 | * 65 | * Other (mixed) configuration switches are listed here: 66 | * ASSIMP_BUILD_NO_COMPRESSED_X 67 | * - Disable support for compressed X files (zip) 68 | * ASSIMP_BUILD_NO_COMPRESSED_BLEND 69 | * - Disable support for compressed Blender files (zip) 70 | * ASSIMP_BUILD_NO_COMPRESSED_IFC 71 | * - Disable support for IFCZIP files (unzip) 72 | */ 73 | ////////////////////////////////////////////////////////////////////////// 74 | 75 | #ifndef ASSIMP_BUILD_NO_COMPRESSED_X 76 | # define ASSIMP_BUILD_NEED_Z_INFLATE 77 | #endif 78 | 79 | #ifndef ASSIMP_BUILD_NO_COMPRESSED_BLEND 80 | # define ASSIMP_BUILD_NEED_Z_INFLATE 81 | #endif 82 | 83 | #ifndef ASSIMP_BUILD_NO_COMPRESSED_IFC 84 | # define ASSIMP_BUILD_NEED_Z_INFLATE 85 | # define ASSIMP_BUILD_NEED_UNZIP 86 | #endif 87 | 88 | #ifndef ASSIMP_BUILD_NO_Q3BSP_IMPORTER 89 | # define ASSIMP_BUILD_NEED_Z_INFLATE 90 | # define ASSIMP_BUILD_NEED_UNZIP 91 | #endif 92 | 93 | ////////////////////////////////////////////////////////////////////////// 94 | /* Define ASSIMP_BUILD_NO_XX_PROCESS to disable a specific 95 | * post processing step. This is the current list of process names ('XX'): 96 | * CALCTANGENTS 97 | * JOINVERTICES 98 | * TRIANGULATE 99 | * GENFACENORMALS 100 | * GENVERTEXNORMALS 101 | * REMOVEVC 102 | * SPLITLARGEMESHES 103 | * PRETRANSFORMVERTICES 104 | * LIMITBONEWEIGHTS 105 | * VALIDATEDS 106 | * IMPROVECACHELOCALITY 107 | * FIXINFACINGNORMALS 108 | * REMOVE_REDUNDANTMATERIALS 109 | * OPTIMIZEGRAPH 110 | * SORTBYPTYPE 111 | * FINDINVALIDDATA 112 | * TRANSFORMTEXCOORDS 113 | * GENUVCOORDS 114 | * ENTITYMESHBUILDER 115 | * MAKELEFTHANDED 116 | * FLIPUVS 117 | * FLIPWINDINGORDER 118 | * OPTIMIZEMESHES 119 | * OPTIMIZEANIMS 120 | * OPTIMIZEGRAPH 121 | * GENENTITYMESHES 122 | * FIXTEXTUREPATHS */ 123 | ////////////////////////////////////////////////////////////////////////// 124 | 125 | #ifdef _MSC_VER 126 | # undef ASSIMP_API 127 | 128 | ////////////////////////////////////////////////////////////////////////// 129 | /* Define 'ASSIMP_BUILD_DLL_EXPORT' to build a DLL of the library */ 130 | ////////////////////////////////////////////////////////////////////////// 131 | # ifdef ASSIMP_BUILD_DLL_EXPORT 132 | # define ASSIMP_API __declspec(dllexport) 133 | # define ASSIMP_API_WINONLY __declspec(dllexport) 134 | # pragma warning (disable : 4251) 135 | 136 | ////////////////////////////////////////////////////////////////////////// 137 | /* Define 'ASSIMP_DLL' before including Assimp to link to ASSIMP in 138 | * an external DLL under Windows. Default is static linkage. */ 139 | ////////////////////////////////////////////////////////////////////////// 140 | # elif (defined ASSIMP_DLL) 141 | # define ASSIMP_API __declspec(dllimport) 142 | # define ASSIMP_API_WINONLY __declspec(dllimport) 143 | # else 144 | # define ASSIMP_API 145 | # define ASSIMP_API_WINONLY 146 | # endif 147 | 148 | /* Force the compiler to inline a function, if possible 149 | */ 150 | # define AI_FORCE_INLINE __forceinline 151 | 152 | /* Tells the compiler that a function never returns. Used in code analysis 153 | * to skip dead paths (e.g. after an assertion evaluated to false). */ 154 | # define AI_WONT_RETURN __declspec(noreturn) 155 | 156 | #elif defined(SWIG) 157 | 158 | /* Do nothing, the relevant defines are all in AssimpSwigPort.i */ 159 | 160 | #else 161 | 162 | # define AI_WONT_RETURN 163 | 164 | # define ASSIMP_API __attribute__ ((visibility("default"))) 165 | # define ASSIMP_API_WINONLY 166 | # define AI_FORCE_INLINE inline 167 | #endif // (defined _MSC_VER) 168 | 169 | #ifdef __GNUC__ 170 | # define AI_WONT_RETURN_SUFFIX __attribute__((noreturn)) 171 | #else 172 | # define AI_WONT_RETURN_SUFFIX 173 | #endif // (defined __clang__) 174 | 175 | #ifdef __cplusplus 176 | /* No explicit 'struct' and 'enum' tags for C++, this keeps showing up 177 | * in doxydocs. 178 | */ 179 | # define C_STRUCT 180 | # define C_ENUM 181 | #else 182 | ////////////////////////////////////////////////////////////////////////// 183 | /* To build the documentation, make sure ASSIMP_DOXYGEN_BUILD 184 | * is defined by Doxygen's preprocessor. The corresponding 185 | * entries in the DOXYFILE are: */ 186 | ////////////////////////////////////////////////////////////////////////// 187 | #if 0 188 | ENABLE_PREPROCESSING = YES 189 | MACRO_EXPANSION = YES 190 | EXPAND_ONLY_PREDEF = YES 191 | SEARCH_INCLUDES = YES 192 | INCLUDE_PATH = 193 | INCLUDE_FILE_PATTERNS = 194 | PREDEFINED = ASSIMP_DOXYGEN_BUILD=1 195 | EXPAND_AS_DEFINED = C_STRUCT C_ENUM 196 | SKIP_FUNCTION_MACROS = YES 197 | #endif 198 | ////////////////////////////////////////////////////////////////////////// 199 | /* Doxygen gets confused if we use c-struct typedefs to avoid 200 | * the explicit 'struct' notation. This trick here has the same 201 | * effect as the TYPEDEF_HIDES_STRUCT option, but we don't need 202 | * to typedef all structs/enums. */ 203 | ////////////////////////////////////////////////////////////////////////// 204 | # if (defined ASSIMP_DOXYGEN_BUILD) 205 | # define C_STRUCT 206 | # define C_ENUM 207 | # else 208 | # define C_STRUCT struct 209 | # define C_ENUM enum 210 | # endif 211 | #endif 212 | 213 | #if (defined(__BORLANDC__) || defined (__BCPLUSPLUS__)) 214 | #error Currently, Borland is unsupported. Feel free to port Assimp. 215 | 216 | // "W8059 Packgröße der Struktur geändert" 217 | 218 | #endif 219 | 220 | 221 | ////////////////////////////////////////////////////////////////////////// 222 | /* Define ASSIMP_BUILD_SINGLETHREADED to compile assimp 223 | * without threading support. The library doesn't utilize 224 | * threads then and is itself not threadsafe. */ 225 | ////////////////////////////////////////////////////////////////////////// 226 | #ifndef ASSIMP_BUILD_SINGLETHREADED 227 | # define ASSIMP_BUILD_SINGLETHREADED 228 | #endif 229 | 230 | #if defined(_DEBUG) || ! defined(NDEBUG) 231 | # define ASSIMP_BUILD_DEBUG 232 | #endif 233 | 234 | ////////////////////////////////////////////////////////////////////////// 235 | /* Define ASSIMP_DOUBLE_PRECISION to compile assimp 236 | * with double precision support (64-bit). */ 237 | ////////////////////////////////////////////////////////////////////////// 238 | 239 | #ifdef ASSIMP_DOUBLE_PRECISION 240 | typedef double ai_real; 241 | typedef signed long long int ai_int; 242 | typedef unsigned long long int ai_uint; 243 | #else // ASSIMP_DOUBLE_PRECISION 244 | typedef float ai_real; 245 | typedef signed int ai_int; 246 | typedef unsigned int ai_uint; 247 | #endif // ASSIMP_DOUBLE_PRECISION 248 | 249 | ////////////////////////////////////////////////////////////////////////// 250 | /* Useful constants */ 251 | ////////////////////////////////////////////////////////////////////////// 252 | 253 | /* This is PI. Hi PI. */ 254 | #define AI_MATH_PI (3.141592653589793238462643383279 ) 255 | #define AI_MATH_TWO_PI (AI_MATH_PI * 2.0) 256 | #define AI_MATH_HALF_PI (AI_MATH_PI * 0.5) 257 | 258 | /* And this is to avoid endless casts to float */ 259 | #define AI_MATH_PI_F (3.1415926538f) 260 | #define AI_MATH_TWO_PI_F (AI_MATH_PI_F * 2.0f) 261 | #define AI_MATH_HALF_PI_F (AI_MATH_PI_F * 0.5f) 262 | 263 | /* Tiny macro to convert from radians to degrees and back */ 264 | #define AI_DEG_TO_RAD(x) ((x)*(ai_real)0.0174532925) 265 | #define AI_RAD_TO_DEG(x) ((x)*(ai_real)57.2957795) 266 | 267 | /* Support for big-endian builds */ 268 | #if defined(__BYTE_ORDER__) 269 | # if (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) 270 | # if !defined(__BIG_ENDIAN__) 271 | # define __BIG_ENDIAN__ 272 | # endif 273 | # else /* little endian */ 274 | # if defined (__BIG_ENDIAN__) 275 | # undef __BIG_ENDIAN__ 276 | # endif 277 | # endif 278 | #endif 279 | #if defined(__BIG_ENDIAN__) 280 | # define AI_BUILD_BIG_ENDIAN 281 | #endif 282 | 283 | 284 | /* To avoid running out of memory 285 | * This can be adjusted for specific use cases 286 | * It's NOT a total limit, just a limit for individual allocations 287 | */ 288 | #define AI_MAX_ALLOC(type) ((256U * 1024 * 1024) / sizeof(type)) 289 | 290 | #endif // !! AI_DEFINES_H_INC 291 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/quaternion.inl: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2017, assimp team 7 | 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following 13 | conditions are met: 14 | 15 | * Redistributions of source code must retain the above 16 | copyright notice, this list of conditions and the 17 | following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the 21 | following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | 24 | * Neither the name of the assimp team, nor the names of its 25 | contributors may be used to endorse or promote products 26 | derived from this software without specific prior 27 | written permission of the assimp team. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | --------------------------------------------------------------------------- 41 | */ 42 | 43 | /** @file quaternion.inl 44 | * @brief Inline implementation of aiQuaterniont operators 45 | */ 46 | #pragma once 47 | #ifndef AI_QUATERNION_INL_INC 48 | #define AI_QUATERNION_INL_INC 49 | 50 | #ifdef __cplusplus 51 | #include "quaternion.h" 52 | 53 | #include 54 | 55 | // --------------------------------------------------------------------------- 56 | template 57 | bool aiQuaterniont::operator== (const aiQuaterniont& o) const 58 | { 59 | return x == o.x && y == o.y && z == o.z && w == o.w; 60 | } 61 | 62 | // --------------------------------------------------------------------------- 63 | template 64 | bool aiQuaterniont::operator!= (const aiQuaterniont& o) const 65 | { 66 | return !(*this == o); 67 | } 68 | 69 | // --------------------------------------------------------------------------- 70 | template 71 | inline bool aiQuaterniont::Equal(const aiQuaterniont& o, TReal epsilon) const { 72 | return 73 | std::abs(x - o.x) <= epsilon && 74 | std::abs(y - o.y) <= epsilon && 75 | std::abs(z - o.z) <= epsilon && 76 | std::abs(w - o.w) <= epsilon; 77 | } 78 | 79 | // --------------------------------------------------------------------------- 80 | // Constructs a quaternion from a rotation matrix 81 | template 82 | inline aiQuaterniont::aiQuaterniont( const aiMatrix3x3t &pRotMatrix) 83 | { 84 | TReal t = pRotMatrix.a1 + pRotMatrix.b2 + pRotMatrix.c3; 85 | 86 | // large enough 87 | if( t > static_cast(0)) 88 | { 89 | TReal s = std::sqrt(1 + t) * static_cast(2.0); 90 | x = (pRotMatrix.c2 - pRotMatrix.b3) / s; 91 | y = (pRotMatrix.a3 - pRotMatrix.c1) / s; 92 | z = (pRotMatrix.b1 - pRotMatrix.a2) / s; 93 | w = static_cast(0.25) * s; 94 | } // else we have to check several cases 95 | else if( pRotMatrix.a1 > pRotMatrix.b2 && pRotMatrix.a1 > pRotMatrix.c3 ) 96 | { 97 | // Column 0: 98 | TReal s = std::sqrt( static_cast(1.0) + pRotMatrix.a1 - pRotMatrix.b2 - pRotMatrix.c3) * static_cast(2.0); 99 | x = static_cast(0.25) * s; 100 | y = (pRotMatrix.b1 + pRotMatrix.a2) / s; 101 | z = (pRotMatrix.a3 + pRotMatrix.c1) / s; 102 | w = (pRotMatrix.c2 - pRotMatrix.b3) / s; 103 | } 104 | else if( pRotMatrix.b2 > pRotMatrix.c3) 105 | { 106 | // Column 1: 107 | TReal s = std::sqrt( static_cast(1.0) + pRotMatrix.b2 - pRotMatrix.a1 - pRotMatrix.c3) * static_cast(2.0); 108 | x = (pRotMatrix.b1 + pRotMatrix.a2) / s; 109 | y = static_cast(0.25) * s; 110 | z = (pRotMatrix.c2 + pRotMatrix.b3) / s; 111 | w = (pRotMatrix.a3 - pRotMatrix.c1) / s; 112 | } else 113 | { 114 | // Column 2: 115 | TReal s = std::sqrt( static_cast(1.0) + pRotMatrix.c3 - pRotMatrix.a1 - pRotMatrix.b2) * static_cast(2.0); 116 | x = (pRotMatrix.a3 + pRotMatrix.c1) / s; 117 | y = (pRotMatrix.c2 + pRotMatrix.b3) / s; 118 | z = static_cast(0.25) * s; 119 | w = (pRotMatrix.b1 - pRotMatrix.a2) / s; 120 | } 121 | } 122 | 123 | // --------------------------------------------------------------------------- 124 | // Construction from euler angles 125 | template 126 | inline aiQuaterniont::aiQuaterniont( TReal fPitch, TReal fYaw, TReal fRoll ) 127 | { 128 | const TReal fSinPitch(std::sin(fPitch*static_cast(0.5))); 129 | const TReal fCosPitch(std::cos(fPitch*static_cast(0.5))); 130 | const TReal fSinYaw(std::sin(fYaw*static_cast(0.5))); 131 | const TReal fCosYaw(std::cos(fYaw*static_cast(0.5))); 132 | const TReal fSinRoll(std::sin(fRoll*static_cast(0.5))); 133 | const TReal fCosRoll(std::cos(fRoll*static_cast(0.5))); 134 | const TReal fCosPitchCosYaw(fCosPitch*fCosYaw); 135 | const TReal fSinPitchSinYaw(fSinPitch*fSinYaw); 136 | x = fSinRoll * fCosPitchCosYaw - fCosRoll * fSinPitchSinYaw; 137 | y = fCosRoll * fSinPitch * fCosYaw + fSinRoll * fCosPitch * fSinYaw; 138 | z = fCosRoll * fCosPitch * fSinYaw - fSinRoll * fSinPitch * fCosYaw; 139 | w = fCosRoll * fCosPitchCosYaw + fSinRoll * fSinPitchSinYaw; 140 | } 141 | 142 | // --------------------------------------------------------------------------- 143 | // Returns a matrix representation of the quaternion 144 | template 145 | inline aiMatrix3x3t aiQuaterniont::GetMatrix() const 146 | { 147 | aiMatrix3x3t resMatrix; 148 | resMatrix.a1 = static_cast(1.0) - static_cast(2.0) * (y * y + z * z); 149 | resMatrix.a2 = static_cast(2.0) * (x * y - z * w); 150 | resMatrix.a3 = static_cast(2.0) * (x * z + y * w); 151 | resMatrix.b1 = static_cast(2.0) * (x * y + z * w); 152 | resMatrix.b2 = static_cast(1.0) - static_cast(2.0) * (x * x + z * z); 153 | resMatrix.b3 = static_cast(2.0) * (y * z - x * w); 154 | resMatrix.c1 = static_cast(2.0) * (x * z - y * w); 155 | resMatrix.c2 = static_cast(2.0) * (y * z + x * w); 156 | resMatrix.c3 = static_cast(1.0) - static_cast(2.0) * (x * x + y * y); 157 | 158 | return resMatrix; 159 | } 160 | 161 | // --------------------------------------------------------------------------- 162 | // Construction from an axis-angle pair 163 | template 164 | inline aiQuaterniont::aiQuaterniont( aiVector3t axis, TReal angle) 165 | { 166 | axis.Normalize(); 167 | 168 | const TReal sin_a = std::sin( angle / 2 ); 169 | const TReal cos_a = std::cos( angle / 2 ); 170 | x = axis.x * sin_a; 171 | y = axis.y * sin_a; 172 | z = axis.z * sin_a; 173 | w = cos_a; 174 | } 175 | // --------------------------------------------------------------------------- 176 | // Construction from am existing, normalized quaternion 177 | template 178 | inline aiQuaterniont::aiQuaterniont( aiVector3t normalized) 179 | { 180 | x = normalized.x; 181 | y = normalized.y; 182 | z = normalized.z; 183 | 184 | const TReal t = static_cast(1.0) - (x*x) - (y*y) - (z*z); 185 | 186 | if (t < static_cast(0.0)) { 187 | w = static_cast(0.0); 188 | } 189 | else w = std::sqrt (t); 190 | } 191 | 192 | // --------------------------------------------------------------------------- 193 | // Performs a spherical interpolation between two quaternions 194 | // Implementation adopted from the gmtl project. All others I found on the net fail in some cases. 195 | // Congrats, gmtl! 196 | template 197 | inline void aiQuaterniont::Interpolate( aiQuaterniont& pOut, const aiQuaterniont& pStart, const aiQuaterniont& pEnd, TReal pFactor) 198 | { 199 | // calc cosine theta 200 | TReal cosom = pStart.x * pEnd.x + pStart.y * pEnd.y + pStart.z * pEnd.z + pStart.w * pEnd.w; 201 | 202 | // adjust signs (if necessary) 203 | aiQuaterniont end = pEnd; 204 | if( cosom < static_cast(0.0)) 205 | { 206 | cosom = -cosom; 207 | end.x = -end.x; // Reverse all signs 208 | end.y = -end.y; 209 | end.z = -end.z; 210 | end.w = -end.w; 211 | } 212 | 213 | // Calculate coefficients 214 | TReal sclp, sclq; 215 | if( (static_cast(1.0) - cosom) > static_cast(0.0001)) // 0.0001 -> some epsillon 216 | { 217 | // Standard case (slerp) 218 | TReal omega, sinom; 219 | omega = std::acos( cosom); // extract theta from dot product's cos theta 220 | sinom = std::sin( omega); 221 | sclp = std::sin( (static_cast(1.0) - pFactor) * omega) / sinom; 222 | sclq = std::sin( pFactor * omega) / sinom; 223 | } else 224 | { 225 | // Very close, do linear interp (because it's faster) 226 | sclp = static_cast(1.0) - pFactor; 227 | sclq = pFactor; 228 | } 229 | 230 | pOut.x = sclp * pStart.x + sclq * end.x; 231 | pOut.y = sclp * pStart.y + sclq * end.y; 232 | pOut.z = sclp * pStart.z + sclq * end.z; 233 | pOut.w = sclp * pStart.w + sclq * end.w; 234 | } 235 | 236 | // --------------------------------------------------------------------------- 237 | template 238 | inline aiQuaterniont& aiQuaterniont::Normalize() 239 | { 240 | // compute the magnitude and divide through it 241 | const TReal mag = std::sqrt(x*x + y*y + z*z + w*w); 242 | if (mag) 243 | { 244 | const TReal invMag = static_cast(1.0)/mag; 245 | x *= invMag; 246 | y *= invMag; 247 | z *= invMag; 248 | w *= invMag; 249 | } 250 | return *this; 251 | } 252 | 253 | // --------------------------------------------------------------------------- 254 | template 255 | inline aiQuaterniont aiQuaterniont::operator* (const aiQuaterniont& t) const 256 | { 257 | return aiQuaterniont(w*t.w - x*t.x - y*t.y - z*t.z, 258 | w*t.x + x*t.w + y*t.z - z*t.y, 259 | w*t.y + y*t.w + z*t.x - x*t.z, 260 | w*t.z + z*t.w + x*t.y - y*t.x); 261 | } 262 | 263 | // --------------------------------------------------------------------------- 264 | template 265 | inline aiQuaterniont& aiQuaterniont::Conjugate () 266 | { 267 | x = -x; 268 | y = -y; 269 | z = -z; 270 | return *this; 271 | } 272 | 273 | // --------------------------------------------------------------------------- 274 | template 275 | inline aiVector3t aiQuaterniont::Rotate (const aiVector3t& v) 276 | { 277 | aiQuaterniont q2(0.f,v.x,v.y,v.z), q = *this, qinv = q; 278 | qinv.Conjugate(); 279 | 280 | q = q*q2*qinv; 281 | return aiVector3t(q.x,q.y,q.z); 282 | } 283 | 284 | #endif 285 | #endif // AI_QUATERNION_INL_INC 286 | -------------------------------------------------------------------------------- /ThirdParty/assimp/include/assimp/matrix4x4.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2017, assimp team 7 | 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following 13 | conditions are met: 14 | 15 | * Redistributions of source code must retain the above 16 | copyright notice, this list of conditions and the 17 | following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the 21 | following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | 24 | * Neither the name of the assimp team, nor the names of its 25 | contributors may be used to endorse or promote products 26 | derived from this software without specific prior 27 | written permission of the assimp team. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | --------------------------------------------------------------------------- 41 | */ 42 | /** @file matrix4x4.h 43 | * @brief 4x4 matrix structure, including operators when compiling in C++ 44 | */ 45 | #pragma once 46 | #ifndef AI_MATRIX4X4_H_INC 47 | #define AI_MATRIX4X4_H_INC 48 | 49 | #include "vector3.h" 50 | #include "defs.h" 51 | 52 | #ifdef __cplusplus 53 | 54 | template class aiMatrix3x3t; 55 | template class aiQuaterniont; 56 | 57 | // --------------------------------------------------------------------------- 58 | /** @brief Represents a row-major 4x4 matrix, use this for homogeneous 59 | * coordinates. 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 aiMatrix4x4t 69 | { 70 | public: 71 | 72 | /** set to identity */ 73 | aiMatrix4x4t (); 74 | 75 | /** construction from single values */ 76 | aiMatrix4x4t ( TReal _a1, TReal _a2, TReal _a3, TReal _a4, 77 | TReal _b1, TReal _b2, TReal _b3, TReal _b4, 78 | TReal _c1, TReal _c2, TReal _c3, TReal _c4, 79 | TReal _d1, TReal _d2, TReal _d3, TReal _d4); 80 | 81 | 82 | /** construction from 3x3 matrix, remaining elements are set to identity */ 83 | explicit aiMatrix4x4t( const aiMatrix3x3t& m); 84 | 85 | /** construction from position, rotation and scaling components 86 | * @param scaling The scaling for the x,y,z axes 87 | * @param rotation The rotation as a hamilton quaternion 88 | * @param position The position for the x,y,z axes 89 | */ 90 | aiMatrix4x4t(const aiVector3t& scaling, const aiQuaterniont& rotation, 91 | const aiVector3t& position); 92 | 93 | public: 94 | 95 | // array access operators 96 | /** @fn TReal* operator[] (unsigned int p_iIndex) 97 | * @param [in] p_iIndex - index of the row. 98 | * @return pointer to pointed row. 99 | */ 100 | TReal* operator[] (unsigned int p_iIndex); 101 | 102 | /** @fn const TReal* operator[] (unsigned int p_iIndex) const 103 | * @overload TReal* operator[] (unsigned int p_iIndex) 104 | */ 105 | const TReal* operator[] (unsigned int p_iIndex) const; 106 | 107 | // comparison operators 108 | bool operator== (const aiMatrix4x4t& m) const; 109 | bool operator!= (const aiMatrix4x4t& m) const; 110 | 111 | bool Equal(const aiMatrix4x4t& m, TReal epsilon = 1e-6) const; 112 | 113 | // matrix multiplication. 114 | aiMatrix4x4t& operator *= (const aiMatrix4x4t& m); 115 | aiMatrix4x4t operator * (const aiMatrix4x4t& m) const; 116 | aiMatrix4x4t operator * (const TReal& aFloat) const; 117 | aiMatrix4x4t operator + (const aiMatrix4x4t& aMatrix) const; 118 | 119 | template 120 | operator aiMatrix4x4t () const; 121 | 122 | public: 123 | 124 | // ------------------------------------------------------------------- 125 | /** @brief Transpose the matrix */ 126 | aiMatrix4x4t& Transpose(); 127 | 128 | // ------------------------------------------------------------------- 129 | /** @brief Invert the matrix. 130 | * If the matrix is not invertible all elements are set to qnan. 131 | * Beware, use (f != f) to check whether a TReal f is qnan. 132 | */ 133 | aiMatrix4x4t& Inverse(); 134 | TReal Determinant() const; 135 | 136 | 137 | // ------------------------------------------------------------------- 138 | /** @brief Returns true of the matrix is the identity matrix. 139 | * The check is performed against a not so small epsilon. 140 | */ 141 | inline bool IsIdentity() const; 142 | 143 | // ------------------------------------------------------------------- 144 | /** @brief Decompose a trafo matrix into its original components 145 | * @param scaling Receives the output scaling for the x,y,z axes 146 | * @param rotation Receives the output rotation as a hamilton 147 | * quaternion 148 | * @param position Receives the output position for the x,y,z axes 149 | */ 150 | void Decompose (aiVector3t& scaling, aiQuaterniont& rotation, 151 | aiVector3t& position) const; 152 | 153 | // ------------------------------------------------------------------- 154 | /** @fn void Decompose(aiVector3t& pScaling, aiVector3t& pRotation, aiVector3t& pPosition) const 155 | * @brief Decompose a trafo matrix into its original components. 156 | * Thx to good FAQ at http://www.gamedev.ru/code/articles/faq_matrix_quat 157 | * @param [out] pScaling - Receives the output scaling for the x,y,z axes. 158 | * @param [out] pRotation - Receives the output rotation as a Euler angles. 159 | * @param [out] pPosition - Receives the output position for the x,y,z axes. 160 | */ 161 | void Decompose(aiVector3t& pScaling, aiVector3t& pRotation, aiVector3t& pPosition) const; 162 | 163 | // ------------------------------------------------------------------- 164 | /** @fn void Decompose(aiVector3t& pScaling, aiVector3t& pRotationAxis, TReal& pRotationAngle, aiVector3t& pPosition) const 165 | * @brief Decompose a trafo matrix into its original components 166 | * Thx to good FAQ at http://www.gamedev.ru/code/articles/faq_matrix_quat 167 | * @param [out] pScaling - Receives the output scaling for the x,y,z axes. 168 | * @param [out] pRotationAxis - Receives the output rotation axis. 169 | * @param [out] pRotationAngle - Receives the output rotation angle for @ref pRotationAxis. 170 | * @param [out] pPosition - Receives the output position for the x,y,z axes. 171 | */ 172 | void Decompose(aiVector3t& pScaling, aiVector3t& pRotationAxis, TReal& pRotationAngle, aiVector3t& pPosition) const; 173 | 174 | // ------------------------------------------------------------------- 175 | /** @brief Decompose a trafo matrix with no scaling into its 176 | * original components 177 | * @param rotation Receives the output rotation as a hamilton 178 | * quaternion 179 | * @param position Receives the output position for the x,y,z axes 180 | */ 181 | void DecomposeNoScaling (aiQuaterniont& rotation, 182 | aiVector3t& position) const; 183 | 184 | 185 | // ------------------------------------------------------------------- 186 | /** @brief Creates a trafo matrix from a set of euler angles 187 | * @param x Rotation angle for the x-axis, in radians 188 | * @param y Rotation angle for the y-axis, in radians 189 | * @param z Rotation angle for the z-axis, in radians 190 | */ 191 | aiMatrix4x4t& FromEulerAnglesXYZ(TReal x, TReal y, TReal z); 192 | aiMatrix4x4t& FromEulerAnglesXYZ(const aiVector3t& blubb); 193 | 194 | public: 195 | // ------------------------------------------------------------------- 196 | /** @brief Returns a rotation matrix for a rotation around the x axis 197 | * @param a Rotation angle, in radians 198 | * @param out Receives the output matrix 199 | * @return Reference to the output matrix 200 | */ 201 | static aiMatrix4x4t& RotationX(TReal a, aiMatrix4x4t& out); 202 | 203 | // ------------------------------------------------------------------- 204 | /** @brief Returns a rotation matrix for a rotation around the y axis 205 | * @param a Rotation angle, in radians 206 | * @param out Receives the output matrix 207 | * @return Reference to the output matrix 208 | */ 209 | static aiMatrix4x4t& RotationY(TReal a, aiMatrix4x4t& out); 210 | 211 | // ------------------------------------------------------------------- 212 | /** @brief Returns a rotation matrix for a rotation around the z axis 213 | * @param a Rotation angle, in radians 214 | * @param out Receives the output matrix 215 | * @return Reference to the output matrix 216 | */ 217 | static aiMatrix4x4t& RotationZ(TReal a, aiMatrix4x4t& out); 218 | 219 | // ------------------------------------------------------------------- 220 | /** Returns a rotation matrix for a rotation around an arbitrary axis. 221 | * @param a Rotation angle, in radians 222 | * @param axis Rotation axis, should be a normalized vector. 223 | * @param out Receives the output matrix 224 | * @return Reference to the output matrix 225 | */ 226 | static aiMatrix4x4t& Rotation(TReal a, const aiVector3t& axis, 227 | aiMatrix4x4t& out); 228 | 229 | // ------------------------------------------------------------------- 230 | /** @brief Returns a translation matrix 231 | * @param v Translation vector 232 | * @param out Receives the output matrix 233 | * @return Reference to the output matrix 234 | */ 235 | static aiMatrix4x4t& Translation( const aiVector3t& v, 236 | aiMatrix4x4t& out); 237 | 238 | // ------------------------------------------------------------------- 239 | /** @brief Returns a scaling matrix 240 | * @param v Scaling vector 241 | * @param out Receives the output matrix 242 | * @return Reference to the output matrix 243 | */ 244 | static aiMatrix4x4t& Scaling( const aiVector3t& v, aiMatrix4x4t& out); 245 | 246 | // ------------------------------------------------------------------- 247 | /** @brief A function for creating a rotation matrix that rotates a 248 | * vector called "from" into another vector called "to". 249 | * Input : from[3], to[3] which both must be *normalized* non-zero vectors 250 | * Output: mtx[3][3] -- a 3x3 matrix in column-major form 251 | * Authors: Tomas Mueller, John Hughes 252 | * "Efficiently Building a Matrix to Rotate One Vector to Another" 253 | * Journal of Graphics Tools, 4(4):1-4, 1999 254 | */ 255 | static aiMatrix4x4t& FromToMatrix(const aiVector3t& from, 256 | const aiVector3t& to, aiMatrix4x4t& out); 257 | 258 | public: 259 | TReal a1, a2, a3, a4; 260 | TReal b1, b2, b3, b4; 261 | TReal c1, c2, c3, c4; 262 | TReal d1, d2, d3, d4; 263 | }; 264 | 265 | typedef aiMatrix4x4t aiMatrix4x4; 266 | 267 | #else 268 | 269 | struct aiMatrix4x4 { 270 | ai_real a1, a2, a3, a4; 271 | ai_real b1, b2, b3, b4; 272 | ai_real c1, c2, c3, c4; 273 | ai_real d1, d2, d3, d4; 274 | }; 275 | 276 | 277 | #endif // __cplusplus 278 | 279 | #endif // AI_MATRIX4X4_H_INC 280 | --------------------------------------------------------------------------------