mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 22:47:29 +08:00
[saco] Implement/match CEntity::GetDistanceFromPoint(...)
This commit is contained in:
parent
89573e770f
commit
c2d3f0cfda
@ -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);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
|
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user