Code:
int __thiscall CGObject_C__TranslateRotation(WoWUnit *this, Matrix4 *mat)
{
W_VTable *vftable; // edx@1
void (*GetFacing)(void); // eax@1
float wowposX; // [sp+Ch] [bp-Ch]@1
float wowposY; // [sp+10h] [bp-8h]@1
float wowposZ; // [sp+14h] [bp-4h]@1
vftable = this->Object.VTable;
mat->m1 = 0.0;
mat->m2 = 0.0;
GetFacing = vftable->GetFacing;
mat->m3 = 0.0;
mat->m4 = 1.0;
wowposZ = 1.0;
wowposX = 0.0;
wowposY = 0.0;
GetFacing();
sub_9670A0(mat, 0.0, (WOWPOS *)&wowposX);
return (int)mat;
}
Code:
float *__thiscall sub_9670A0(Matrix4 *this, float length, WOWPOS *pfOutLength)
{
WOWPOS *result; // eax@1
float halfLength; // ST08_4@1
double v5; // st7@1
float sinHalfLength; // [sp+Ch] [bp-4h]@1
halfLength = length * 0.5;
length = cos(halfLength);
sinHalfLength = sin(halfLength);
result = pfOutLength;
this->m4 = length;
v5 = sinHalfLength;
this->m1 = result->X * sinHalfLength;
this->m2 = result->Y * v5;
this->m3 = v5 * result->Z;
return (float *)result;
}