You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Upon parsing Quaternions from NodeAnim*, I was stumbling upon incorrect Quaternions. The aiQuaterniont struct puts W first, but System.Numerics.Quaternion is X first. So it appears Silk.NET is casting those aiQuaternionT* to System.Numerics.Quaternion or something, which results in W being at X which is wrong.
Here's my workaround for parsing them:
NodeAnim*chan= a->MChannels[j];varpositions=new(float, Vector3)[chan->MNumPositionKeys];for(intk=0;k< positions.Length;k++){VectorKeypos= chan->MPositionKeys[k];
positions[k]=((float)pos.MTime, pos.MValue);}varrotations=new(float, Quaternion)[chan->MNumRotationKeys];for(intk=0;k< rotations.Length;k++){QuatKeyrot= chan->MRotationKeys[k];
rotations[k]=((float)rot.MTime,new Quaternion(rot.MValue.Y, rot.MValue.Z, rot.MValue.W, rot.MValue.X));// HERE: Incorrectly casted by library, so order is shifted by one field}varscales=new(float, Vector3)[chan->MNumScalingKeys];for(intk=0;k< scales.Length;k++){VectorKeyscl= chan->MScalingKeys[k];
scales[k]=((float)scl.MTime, scl.MValue);}
Comments
Platform: Desktop
Framework Version: .NET 6.0
API: OpenGL 3.3 Core
I'm not sure if this is unique to NodeAnim or if it applies all over the library, so it needs some looking into
The text was updated successfully, but these errors were encountered:
Well this is also similarly the case with Matrix4x4. The assimp ones are column major, but the System.Numerics ones are row major. Having it be consistent with the rest of .net makes it way easier. At the moment, you have to transpose the matrices you get from Silk.NET.Assimp. If these inconsistencies were addressed it'd be a lot easier to follow tutorials (and make a proper example project with)
Edit: Could also apply to Matrix3x3 although I didn't check any of those
Summary
Upon parsing Quaternions from
NodeAnim*
, I was stumbling upon incorrect Quaternions. TheaiQuaterniont
struct puts W first, but System.Numerics.Quaternion is X first. So it appears Silk.NET is casting those aiQuaternionT* to System.Numerics.Quaternion or something, which results in W being at X which is wrong.Here's my workaround for parsing them:
Comments
I'm not sure if this is unique to
NodeAnim
or if it applies all over the library, so it needs some looking intoThe text was updated successfully, but these errors were encountered: