GLKQuaternionsの奇妙な問題を理解しようとしています。クォータニオンの情報を出力しようとすると、毎回w=0の値になります。ただし、デバッガ領域では、-4.37114e-08がこの値に格納されていることが明確に示されています。理由がわかりません。私の印刷物の声明は言う:
NSLog(@"\n\nSLERP: Animation.Current:x:%f,y:%f,z:%f,w:%f and Animation.End:x:%f,y:%f,z:%f,w:%f", animation.Current.x, animation.Current.y, animation.Current.z, animation.Current.w, animation.End.x, animation.End.y, animation.End.z, animation.End.w);
私の構造体は
typedef struct{
GLKQuaternion Start; //starting orientation
GLKQuaternion End; //ending orientation
GLKQuaternion Current; //current interpolated orientation
float Elapsed; //time span in seconds for a slerp fraction between 0 and 1
float Duration; //time span in seconds for a slerp fraction between 0 and 1
}Animation; //enables smooth 3D transitions
デバッガーは次のように表示されます。
同時にデバッガーでanimation.End.w=-4.37114e-08と述べている間は、animation.End.w=-4.37114e-08であることに注意してください。印刷ステートメントの直後にブレークポイントを設定しました。誰かがこれを引き起こす原因を知っていますか?wの変数に関する私の計算に干渉していると思います。