//AABB - [2020-06-22 11:41:46]
#ifndef _SAT_H_
#define _SAT_H_

#include "CFTTMatrix32.h"
#include "sh_struct.h"
#include "TAnimData.h"
#include "CFTTQuaternion32.h"
/*
0017AC88 SAT_LoadAnimation(char const*,int &)
0017ADE0 SAT_FreeAnimation(TSATAnim_TSX *)
0017ADEA SAT_GenerateSample(TSATFrameSample *,CFTTMatrix32 &)
0017AFAC SAT_BlendSamples(TSATFrameSample *,int,TSATFrameSample_FP *,TSATFrameSample_FP *,float)
0017B12C SAT_BlendSamples(TSATFrameSample *,int,TSATFrameSample *,TSATFrameSample *,float)
0017B228 SAT_GetBonePosExplicit(short *,TSATAnim_TSX *,int,int)
0017B374 SAT_CreateSamples(TSATFrameSample *,TSATAnim_TSX *,float)
0017B508 SAT_ResolveHierarchy(CFTTMatrix32 *,TFTTHierarchyHeader *)
0017B562 SAT_ResolveHierarchyChild(CFTTMatrix32 *,TFTTHierarchyHeader *,int,CFTTMatrix32 *)
0017B5BA SAT_CreateMatrices(TSATAnim_TSX *,CFTTMatrix32 *,TSATFrameSample *,int,TFTTHierarchyHeader *,CFTTMatrix32 *)
0017B654 SAT_GenerateMatrix(CFTTMatrix32 &,TSATFrameSample *)
0017B6A2 SAT_CreateMatrixPartial(int,int,CFTTMatrix32 *,TSATFrameSample *,TFTTHierarchyHeader *)
0017B6D0 SAT_RotateSampleX(TSATFrameSample *,float,bool)
0017B800 SAT_RotateSampleY(TSATFrameSample *,float,bool)
0017B8C0 SAT_RotateSampleZ(TSATFrameSample *,float,bool)
*/

struct TSATFrameSample {
  CFTTQuaternion32 filed_0;
  float filed_10[3];
};

struct TSATFrameSample_FP {
  short field_0[4];
  short field_10[3];
};

#pragma pack(push,1)
typedef struct {
  sint16 field_0;
  sint16 field_2;
  sint8 filed_4;
  sint8 filed_5;
  uchar filed_6;
  uchar filed_7;
  sint8 filed_8[0x2a];
  sint8 filed_32;
  sint8 filed_33[0x2d];
  union
  {
    int filed_60;
    short *pfiled_60;
  }u_60;

  union
  {
    int filed_64;
    short *pfiled_64;
  }u_64;

} TSATAnim_TSX;
#pragma pack(pop)

TSATAnim_TSX *SAT_LoadAnimation(char const *, int &);                                                                    //0017AC88
void SAT_FreeAnimation(TSATAnim_TSX *);                                                                                  //0017ADE0
void SAT_GenerateSample(TSATFrameSample *, CFTTMatrix32 &);                                                              //0017ADEA
void SAT_BlendSamples(TSATFrameSample *, int, TSATFrameSample_FP *, TSATFrameSample_FP *, float);                        //0017AFAC
void SAT_BlendSamples(TSATFrameSample *, int, TSATFrameSample *, TSATFrameSample *, float);                              //0017B12C
void SAT_GetBonePosExplicit(short *, TSATAnim_TSX *, int, int);                                                          //0017B228
void SAT_CreateSamples(TSATFrameSample *, TSATAnim_TSX *, float);                                                        //0017B374
void SAT_ResolveHierarchy(CFTTMatrix32 *, TFTTHierarchyHeader *);                                                        //0017B508
void SAT_ResolveHierarchyChild(CFTTMatrix32 *, TFTTHierarchyHeader *, int, CFTTMatrix32 *);                              //0017B562
void SAT_CreateMatrices(TSATAnim_TSX *, CFTTMatrix32 *, TSATFrameSample *, int, TFTTHierarchyHeader *, CFTTMatrix32 *);  //0017B5BA
void SAT_GenerateMatrix(CFTTMatrix32 &, TSATFrameSample *);                                                              //0017B654
void SAT_CreateMatrixPartial(int, int, CFTTMatrix32 *, TSATFrameSample *, TFTTHierarchyHeader *);                        //0017B6A2
void SAT_RotateSampleX(TSATFrameSample *, float, bool);                                                                  //0017B6D0
void SAT_RotateSampleY(TSATFrameSample *, float, bool);                                                                  //0017B800
void SAT_RotateSampleZ(TSATFrameSample *, float, bool);                                                                  //0017B8C0

void FP_ROT2FLOAT4(float *a1, short *a2);
void FP_POS2FLOAT3(float *result, short *a2);

#endif  //_SAT_H_