From da281b7f482618c1d7c580b5e0c778c3f004f79d Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 17 Jul 2024 15:49:17 +0200 Subject: [PATCH] Introduce interpolation mode to vectro and quaternion keys --- code/AssetLib/Step/StepExporter.cpp | 3 - code/AssetLib/USD/USDLoader.cpp | 66 ++++++++++--------- code/AssetLib/USD/USDLoader.h | 60 +++++++++-------- code/AssetLib/USD/USDLoaderImplTinyusdz.cpp | 66 +++++++++---------- code/AssetLib/USD/USDLoaderImplTinyusdz.h | 57 ++++++++-------- .../USD/USDLoaderImplTinyusdzHelper.cpp | 41 ++++++++++++ .../USD/USDLoaderImplTinyusdzHelper.h | 41 ++++++++++++ code/AssetLib/USD/USDLoaderUtil.cpp | 60 ++++++++--------- code/AssetLib/USD/USDLoaderUtil.h | 65 +++++++++--------- code/Common/SpatialSort.cpp | 4 -- include/assimp/SpatialSort.h | 2 +- include/assimp/anim.h | 45 +++++++++---- include/assimp/material.h | 4 +- include/assimp/material.inl | 9 +-- 14 files changed, 310 insertions(+), 213 deletions(-) diff --git a/code/AssetLib/Step/StepExporter.cpp b/code/AssetLib/Step/StepExporter.cpp index 2188ddfec..f5ccf88f6 100644 --- a/code/AssetLib/Step/StepExporter.cpp +++ b/code/AssetLib/Step/StepExporter.cpp @@ -4,7 +4,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2024, assimp team - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -37,11 +36,9 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -@author: Richard Steffen, 2015 ---------------------------------------------------------------------- */ - #ifndef ASSIMP_BUILD_NO_EXPORT #ifndef ASSIMP_BUILD_NO_STEP_EXPORTER diff --git a/code/AssetLib/USD/USDLoader.cpp b/code/AssetLib/USD/USDLoader.cpp index c4669f57f..6757e6a10 100644 --- a/code/AssetLib/USD/USDLoader.cpp +++ b/code/AssetLib/USD/USDLoader.cpp @@ -1,43 +1,46 @@ /* ---------------------------------------------------------------------------- Open Asset Import Library (assimp) ---------------------------------------------------------------------------- +---------------------------------------------------------------------- Copyright (c) 2006-2024, assimp team - All rights reserved. - Redistribution and use of this software in source and binary forms, - with or without modification, are permitted provided that the following - conditions are met: +All rights reserved. - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. - * Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - --------------------------------------------------------------------------- - */ +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +@author: Richard Steffen, 2014 + +---------------------------------------------------------------------- +*/ /** @file USDLoader.cpp * @brief Implementation of the USD importer class @@ -87,8 +90,7 @@ USDImporter::USDImporter() : // ------------------------------------------------------------------------------------------------ -bool USDImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool checkSig) const { - UNUSED(checkSig); +bool USDImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool) const { // Based on token static const uint32_t usdcTokens[] = { AI_MAKE_MAGIC("PXR-USDC") }; bool canRead = CheckMagicToken(pIOHandler, pFile, usdcTokens, AI_COUNT_OF(usdcTokens)); diff --git a/code/AssetLib/USD/USDLoader.h b/code/AssetLib/USD/USDLoader.h index 3d6b58db7..8a045bdb3 100644 --- a/code/AssetLib/USD/USDLoader.h +++ b/code/AssetLib/USD/USDLoader.h @@ -4,39 +4,43 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2024, assimp team - All rights reserved. - Redistribution and use of this software in source and binary forms, - with or without modification, are permitted provided that the - following conditions are met: +All rights reserved. - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. - * Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------- - */ +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +@author: Richard Steffen, 2014 + +---------------------------------------------------------------------- +*/ /** @file USDLoader.h * @brief Declaration of the USD importer class. diff --git a/code/AssetLib/USD/USDLoaderImplTinyusdz.cpp b/code/AssetLib/USD/USDLoaderImplTinyusdz.cpp index 0f293c818..dbe9b6240 100644 --- a/code/AssetLib/USD/USDLoaderImplTinyusdz.cpp +++ b/code/AssetLib/USD/USDLoaderImplTinyusdz.cpp @@ -1,43 +1,43 @@ /* ---------------------------------------------------------------------------- Open Asset Import Library (assimp) ---------------------------------------------------------------------------- +---------------------------------------------------------------------- Copyright (c) 2006-2024, assimp team - All rights reserved. +All rights reserved. - Redistribution and use of this software in source and binary forms, - with or without modification, are permitted provided that the following - conditions are met: +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. - * Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - --------------------------------------------------------------------------- - */ +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ /** @file USDLoader.cpp * @brief Implementation of the USD importer class @@ -72,7 +72,7 @@ Copyright (c) 2006-2024, assimp team #include "../../../contrib/tinyusdz/assimp_tinyusdz_logging.inc" namespace { - const char *const TAG = "tinyusdz loader"; + static constexpr char Tag[] = "tinyusdz loader"; } namespace Assimp { @@ -81,9 +81,7 @@ using namespace std; void USDImporterImplTinyusdz::InternReadFile( const std::string &pFile, aiScene *pScene, - IOSystem *pIOHandler) { - UNUSED(pIOHandler); - UNUSED(TAG); // Ignore unused variable when -Werror enabled + IOSystem *) { // Grab filename for logging purposes size_t pos = pFile.find_last_of('/'); string basePath = pFile.substr(0, pos); diff --git a/code/AssetLib/USD/USDLoaderImplTinyusdz.h b/code/AssetLib/USD/USDLoaderImplTinyusdz.h index 637c58686..69f8c125c 100644 --- a/code/AssetLib/USD/USDLoaderImplTinyusdz.h +++ b/code/AssetLib/USD/USDLoaderImplTinyusdz.h @@ -4,39 +4,40 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2024, assimp team - All rights reserved. +All rights reserved. - Redistribution and use of this software in source and binary forms, - with or without modification, are permitted provided that the - following conditions are met: +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. - * Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------- - */ +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ /** @file USDLoader.h * @brief Declaration of the USD importer class. diff --git a/code/AssetLib/USD/USDLoaderImplTinyusdzHelper.cpp b/code/AssetLib/USD/USDLoaderImplTinyusdzHelper.cpp index 2f10db32e..09d692445 100644 --- a/code/AssetLib/USD/USDLoaderImplTinyusdzHelper.cpp +++ b/code/AssetLib/USD/USDLoaderImplTinyusdzHelper.cpp @@ -1,3 +1,44 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2024, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ + #ifndef ASSIMP_BUILD_NO_USD_IMPORTER #include "USDLoaderImplTinyusdzHelper.h" diff --git a/code/AssetLib/USD/USDLoaderImplTinyusdzHelper.h b/code/AssetLib/USD/USDLoaderImplTinyusdzHelper.h index ee6d96a06..c5eaafd73 100644 --- a/code/AssetLib/USD/USDLoaderImplTinyusdzHelper.h +++ b/code/AssetLib/USD/USDLoaderImplTinyusdzHelper.h @@ -1,3 +1,44 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2024, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ + #pragma once #ifndef AI_USDLOADER_IMPL_TINYUSDZ_HELPER_H_INCLUDED #define AI_USDLOADER_IMPL_TINYUSDZ_HELPER_H_INCLUDED diff --git a/code/AssetLib/USD/USDLoaderUtil.cpp b/code/AssetLib/USD/USDLoaderUtil.cpp index 16f0ba8ae..8d9b22df2 100644 --- a/code/AssetLib/USD/USDLoaderUtil.cpp +++ b/code/AssetLib/USD/USDLoaderUtil.cpp @@ -1,43 +1,43 @@ /* ---------------------------------------------------------------------------- Open Asset Import Library (assimp) ---------------------------------------------------------------------------- +---------------------------------------------------------------------- Copyright (c) 2006-2024, assimp team - All rights reserved. +All rights reserved. - Redistribution and use of this software in source and binary forms, - with or without modification, are permitted provided that the following - conditions are met: +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. - * Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - --------------------------------------------------------------------------- - */ +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ /** @file USDLoader.cpp * @brief Implementation of the USD importer class diff --git a/code/AssetLib/USD/USDLoaderUtil.h b/code/AssetLib/USD/USDLoaderUtil.h index b39cd254e..7601cfbc1 100644 --- a/code/AssetLib/USD/USDLoaderUtil.h +++ b/code/AssetLib/USD/USDLoaderUtil.h @@ -4,39 +4,40 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2024, assimp team - All rights reserved. +All rights reserved. - Redistribution and use of this software in source and binary forms, - with or without modification, are permitted provided that the - following conditions are met: +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. - * Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------- - */ +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ /** @file USDLoader.h * @brief Declaration of the USD importer class. @@ -45,15 +46,15 @@ Copyright (c) 2006-2024, assimp team #ifndef AI_USDLOADER_UTIL_H_INCLUDED #define AI_USDLOADER_UTIL_H_INCLUDED -#include -#include -#include -#include +#include namespace Assimp { + bool isUsda(const std::string &pFile); bool isUsdc(const std::string &pFile); bool isUsdz(const std::string &pFile); bool isUsd(const std::string &pFile); + } // namespace Assimp + #endif // AI_USDLOADER_UTIL_H_INCLUDED diff --git a/code/Common/SpatialSort.cpp b/code/Common/SpatialSort.cpp index 34cb3fb05..6bce63af4 100644 --- a/code/Common/SpatialSort.cpp +++ b/code/Common/SpatialSort.cpp @@ -71,10 +71,6 @@ SpatialSort::SpatialSort() : mPlaneNormal.Normalize(); } -// ------------------------------------------------------------------------------------------------ -// Destructor -SpatialSort::~SpatialSort() = default; - // ------------------------------------------------------------------------------------------------ void SpatialSort::Fill(const aiVector3D *pPositions, unsigned int pNumPositions, unsigned int pElementOffset, diff --git a/include/assimp/SpatialSort.h b/include/assimp/SpatialSort.h index e527b15a2..006234acb 100644 --- a/include/assimp/SpatialSort.h +++ b/include/assimp/SpatialSort.h @@ -79,7 +79,7 @@ public: unsigned int pElementOffset); /** Destructor */ - ~SpatialSort(); + ~SpatialSort() = default; // ------------------------------------------------------------------------------------ /** Sets the input data for the SpatialSort. This replaces existing data, if any. diff --git a/include/assimp/anim.h b/include/assimp/anim.h index 4e29fa0c0..a6b368c02 100644 --- a/include/assimp/anim.h +++ b/include/assimp/anim.h @@ -59,6 +59,28 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. extern "C" { #endif +// --------------------------------------------------------------------------- +/** + */ +enum aiAnimInterpolation { + /** */ + aiAnimInterpolation_Step, + + /** */ + aiAnimInterpolation_Linear, + + /** */ + aiAnimInterpolation_Spherical_Linear, + + /** */ + aiAnimInterpolation_Cubic_Spline, + +/** */ +#ifndef SWIG + _aiAnimInterpolation_Force32Bit = INT_MAX +#endif +}; + // --------------------------------------------------------------------------- /** A time-value pair specifying a certain 3D vector for the given time. */ struct aiVectorKey { @@ -68,21 +90,18 @@ struct aiVectorKey { /** The value of this key */ C_STRUCT aiVector3D mValue; + /** The interpolation setting of this key */ + C_ENUM aiAnimInterpolation mInterpolation; + #ifdef __cplusplus /// @brief The default constructor. aiVectorKey() AI_NO_EXCEPT - : mTime(0.0), - mValue() { - // empty - } + : mTime(0.0), mValue(), mInterpolation(aiAnimInterpolation_Linear) {} /// @brief Construction from a given time and key value. - aiVectorKey(double time, const aiVector3D &value) : - mTime(time), mValue(value) { - // empty - } + mTime(time), mValue(value), mInterpolation(aiAnimInterpolation_Linear){} typedef aiVector3D elem_type; @@ -116,16 +135,16 @@ struct aiQuatKey { /** The value of this key */ C_STRUCT aiQuaternion mValue; + /** The interpolation setting of this key */ + C_ENUM aiAnimInterpolation mInterpolation; + #ifdef __cplusplus aiQuatKey() AI_NO_EXCEPT - : mTime(0.0), - mValue() { - // empty - } + : mTime(0.0), mValue(), mInterpolation(aiAnimInterpolation_Linear) {} /** Construction from a given time and key value */ aiQuatKey(double time, const aiQuaternion &value) : - mTime(time), mValue(value) {} + mTime(time), mValue(value), mInterpolation(aiAnimInterpolation_Linear) {} typedef aiQuaternion elem_type; diff --git a/include/assimp/material.h b/include/assimp/material.h index 484a5192a..a8c6282c4 100644 --- a/include/assimp/material.h +++ b/include/assimp/material.h @@ -1527,7 +1527,7 @@ ASSIMP_API C_ENUM aiReturn aiGetMaterialFloatArray( const char *pKey, unsigned int type, unsigned int index, - ai_real *pOut, + float *pOut, unsigned int *pMax); // --------------------------------------------------------------------------- @@ -1553,7 +1553,7 @@ inline aiReturn aiGetMaterialFloat(const C_STRUCT aiMaterial *pMat, const char *pKey, unsigned int type, unsigned int index, - ai_real *pOut) { + float *pOut) { return aiGetMaterialFloatArray(pMat, pKey, type, index, pOut, (unsigned int *)0x0); } diff --git a/include/assimp/material.inl b/include/assimp/material.inl index fdf837db4..31dd438fe 100644 --- a/include/assimp/material.inl +++ b/include/assimp/material.inl @@ -67,7 +67,7 @@ AI_FORCE_INLINE aiReturn aiMaterial::GetTexture( aiTextureType type, C_STRUCT aiString* path, aiTextureMapping* mapping /*= NULL*/, unsigned int* uvindex /*= NULL*/, - ai_real* blend /*= NULL*/, + float* blend /*= NULL*/, aiTextureOp* op /*= NULL*/, aiTextureMapMode* mapmode /*= NULL*/) const { return ::aiGetMaterialTexture(this,type,index,path,mapping,uvindex,blend,op,mapmode); @@ -136,9 +136,7 @@ AI_FORCE_INLINE aiReturn aiMaterial::Get(const char* pKey,unsigned int type, // Specialisation for a single bool. // Casts floating point and integer to bool template <> -AI_FORCE_INLINE - aiReturn - aiMaterial::Get(const char *pKey, unsigned int type, +AI_FORCE_INLINE aiReturn aiMaterial::Get(const char *pKey, unsigned int type, unsigned int idx, bool &pOut) const { const aiMaterialProperty *prop; const aiReturn ret = ::aiGetMaterialProperty(this, pKey, type, idx, @@ -193,7 +191,7 @@ AI_FORCE_INLINE aiReturn aiMaterial::Get(const char* pKey,unsigned int type, } // --------------------------------------------------------------------------- AI_FORCE_INLINE aiReturn aiMaterial::Get(const char* pKey,unsigned int type, - unsigned int idx,ai_real& pOut) const { + unsigned int idx, float& pOut) const { return aiGetMaterialFloat(this,pKey,type,idx,&pOut); } // --------------------------------------------------------------------------- @@ -312,7 +310,6 @@ AI_FORCE_INLINE aiReturn aiMaterial::AddProperty(const int* pInput, pKey,type,index,aiPTI_Integer); } - // --------------------------------------------------------------------------- // The template specializations below are for backwards compatibility. // The recommended way to add material properties is using the non-template