#include "classes.h" // 0041e4c0 void Point::UpdateNormal(Vector *unk) { float fVar1; float fVar2; float dirX; Point newNormalY; Point PVar3; Point newNormalX; float dirY; Point oldNormalX; Point oldNormalY; oldNormalX = this[2]; if (((float)oldNormalX == g_vectorZero.x) && ((float)this[3] == g_vectorZero.y)) { dirX = unk->x - (float)*this; dirY = unk->y - (float)this[1]; fVar1 = sqrtf(dirX * dirX + dirY * dirY); unk = GHIDRA_CAST(dirX); if (0.0 < fVar1) { unk = GHIDRA_CAST((dirX * (1.0 / fVar1))); dirY = dirY * (1.0 / fVar1); } fVar1 = cos(1.5707964); fVar2 = sin(1.5707964); this[3] = (Point)((float)unk * fVar2 + dirY * fVar1); this[2] = (Point)((float)unk * fVar1 - dirY * fVar2); return; } oldNormalY = this[3]; dirY = unk->y - (float)this[1]; unk = GHIDRA_CAST((unk->x - (float)*this)); fVar1 = sqrtf(dirY * dirY + (float)unk * (float)unk); if (0.0 < fVar1) { unk = GHIDRA_CAST(((float)unk * (1.0 / fVar1))); dirY = dirY * (1.0 / fVar1); } fVar1 = cos(1.5707964); fVar2 = sin(1.5707964); newNormalX = (Point)(((float)unk * fVar1 - dirY * fVar2) + (float)oldNormalX); newNormalY = (Point)((float)unk * fVar2 + dirY * fVar1 + (float)this[3]); this[2] = newNormalX; this[3] = newNormalY; fVar1 = sqrtf((float)newNormalY * (float)newNormalY + (float)newNormalX * (float)newNormalX); if (fVar1 <= 0.0) { PVar3 = this[3]; } else { newNormalY = (Point)((float)newNormalY * (1.0 / fVar1)); newNormalX = (Point)((float)newNormalX * (1.0 / fVar1)); PVar3 = newNormalY; } fVar2 = (float)oldNormalY * (float)newNormalY + (float)oldNormalX * (float)newNormalX; fVar1 = 0.4; if (0.4 <= fVar2) { fVar1 = fVar2; } this[3] = (Point)((float)PVar3 / fVar1); this[2] = (Point)((float)newNormalX / fVar1); return; }