Open bartteunis opened 2 years ago
This requires #9 DQ export option
It seems to correspond to the if-else part in smf_model_load_from_buffer
that is checked for every node:
if (i > 0)
{
// ...
A subtle yet important remark: smf_dq_invert
doesn't invert a DQ but negates it.
See Quaternions and spatial rotation:
It can be proven that the inverse of a unit quaternion is obtained simply by changing the sign of its imaginary components.
smf_dq_invert
, however, changes the sign of all components, so rather it performs a scalar multiplication by -1.
So it is negate
that should be used instead of invert
.
Untested, test to see if this is solved by #9
Bones can be inverted inbetween some keyframes. This works fine in SMF v10 and the corresponding version of the Model Tool because it has additional math for inverting DQs. When porting these animations to SMF1 and previewing in Model Tool 0.8.9, the twitching occurs. Can these corrections be done in the Blender exporter? If so, what should be added to export correct DQs? Is this issue related to DQs or also to matrices?