[saco] Implement/match CEntity::GetDistanceFromPoint(...)

This commit is contained in:
RD42 2024-08-06 19:03:32 +08:00
parent 89573e770f
commit c2d3f0cfda
2 changed files with 19 additions and 0 deletions

View File

@ -232,3 +232,19 @@ void CEntity::TeleportTo(float x, float y, float z)
}
//-----------------------------------------------------------
float CEntity::GetDistanceFromPoint(float X, float Y, float Z)
{
MATRIX4X4 matThis;
float fSX,fSY,fSZ;
GetMatrix(&matThis);
fSX = (matThis.pos.X - X) * (matThis.pos.X - X);
fSY = (matThis.pos.Y - Y) * (matThis.pos.Y - Y);
fSZ = (matThis.pos.Z - Z) * (matThis.pos.Z - Z);
return (float)sqrt(fSX + fSY + fSZ);
}
//-----------------------------------------------------------

View File

@ -26,6 +26,9 @@ public:
UINT GetModelIndex();
void TeleportTo(float x, float y, float z);
float GetDistanceFromPoint(float X, float Y, float Z);
BOOL FUNC_1009FDE0();
VECTOR field_4[5];