* Fix identity matrix check
Adds an extra epsilon value to check the matrix4x4 identity. The method is also used to export to GLTF/GLTF2 format to check node transformation matrices. The epsilon value can be set using AI_CONFIG_CHECK_IDENTITY_MATRIX_EPSILON with the default value set to 10e-3f for backward compatibility of legacy code.
* Fix type of float values in the unit test
* Update matrix4x4.inl
Fix typo
* Update matrix4x4.inl
Remove dead code.
* Add isIdentity-Test
* Update AssimpAPITest_aiMatrix4x4.cpp
---------
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
This commit does not add or remove c’tors or d’tors, so it is *not* ABI-breaking.
If a c’tor/d’tor does nothing else than the default behavior, this commit replaces it with “= default”.
If an initializer list entry does nothing else than the default behavior, this commit removes it. First and foremost, remove default c’tor calls of base classes (always called by the compiler if no other base c’tor is explicitly called) and c’tor calls of members with complex types (e.g. “std::vector”).
In a few instances, user-defined copy c’tors / move c’tors / assignment operators / move assignment operators were replaced with “= default”, too. I only did this if I had a clear understanding of what’s going on.
Also assert if size_t is smaller than uint32_t (probably not necessary)
Note: 32bit builds will crash OOM if a really large model is loaded, as cannot allocate that much in total, let alone contiguously.
The search for a matching importer had a few issues, see #3791. There were two different mechanisms to determine whether an importer accepts a specific file extension:
1. `aiImporterDesc::mFileExtensions`, which was forwarded to the UI via `BaseImporter::GetExtensionList()`.
2. `BaseImporter::CanRead()` when called with `checkSig == false`, which determines whether to actually use that importer.
Both were redundant and got out of sync repeatedly. I removed 2. completely and replaced it with 1., thereby syncing UI/import and shortening all `BaseImporter::CanRead()` implementations.
Further bugfixes:
- fixed glTF2 importer throwing exceptions when checking whether it can load a file
- removed `BaseImporter::SimpleExtensionCheck()` because it is no longer used and had a bug with case sensitivity
Since the `checkSig` parameter in `BaseImporter::CanRead()` is now useless, it can be removed completely. I’m not sure if this would break ABI compatiblity, so I’ll submit it with a later pull request.
std::string s(""); s = ""; calls the copy constructor, which in turn calls strlen(), … assigning a default-constructed string generates fewer instructions and is therefore preferred.
With C++11 uniform initialization, you’d simply write s = { } instead.
“LazyDictBase::WriteObjects()” in the two glTF implementations is only used for export. Since it’s a virtual method, and many compilers have trouble removing unreferenced virtual methods, glTF export stuff is pulled into the binary even if compiling without exports.
This commit removes said virtual function if only compiling for import.
This removes 75 KiB of useless code when compiled with Visual Studio for x64.