-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Hello,
I was wondering if someone could help me. I'm using the DiabloImmortal templates as a guide
to import model data, and for the most part, it has worked out well. However, I have a
problem with importing animation. I think there might be a few errors with QuaternionDequantize()
in AnimationKeyframe.bt.
I assume this function works as follows. It unpacks 3 quaternion floats and calculates the
remaining float. But, I think there are some errors.
v13 bit == 0:
this case looks ok. x,y,z are all assigned.
v13 bit == 1:
w = x, but x is never assigned. Assuming x is uninitialized, this value will always be zero.
v13 bit == 2:
w = y, but y is never assigned. y always zero.
v13 bit == 3:
w = z, but z is never assigned. z always zero.
From what I understand, each switch case (0,1,2,3), represents the largest quaternion component (x,y,z,w)
that was thrown away. And this is the missing component that is being calculated.
This is how I assume it should be:
switch(v13) {
case 0: decode x,y,z, calculate w; break;
case 1: decode y,z,w, calculate x; break;
case 2: decode z,w,x, calculate y; break;
case 3: decode w,x,y, calculate z; break;
}
But, it seems the code is always calculating the 'w' component for each case. How can this be?
Thanks for any help.