"IsValid" checks may produce false negatives
See original GitHub issueIn the project that I’m working on, the package SharpGLTF
was updated from version 1.0.0-alpha0020
to 1.0.0-alpha0025
, and I’m noticing failures now when calling AddSkinnedMesh
. I could track those down to the IsValid
check being performed, specifically the check for IdentityColumn4
: https://github.com/vpenades/SharpGLTF/blob/3dc26e16ec4fe75a4a8aa5cfcd33082e965ba570/src/Shared/_Extensions.cs#L217-L223
As the warnings that I get in Rider, for example, already suggest, this comparison with 1 is not a great check in case the passed-in matrix has been transformed and a tiny floating-point error has been introduced (very likely, and precisely the failure condition in my case). See this link for more details on the warning.
Here’s an example of a matrix that fails this check, but should pass instead: I would appreciate if you could take the time to go through and remove or loosen up these checks to prevent any false negatives.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
@Morilli
AddSkinnedMesh
is part of the SceneBuilder framework, which is somewhat independent from the actual Skin object of the schema.The fix is set in the method that runs when you convert a SceneBuilder into an actual glTF object, so it will run when you convert.
I’m going to add a check in the
AddSkinnedMesh
too, but the fix is in the right location.Thanks, all works fine now with your latest changes.