mirror of
https://github.com/dashr9230/SA-MP.git
synced 2026-10-10 11:43:04 +08:00
[saco] Implement/match VectorNormaliseTo; casting the sum to double picks the fsqrt intrinsic instead of the float sqrt overload
This commit is contained in:
@@ -793,6 +793,17 @@ void VectorCrossProduct(VECTOR *vecOut, VECTOR *vec1, VECTOR *vec2)
|
||||
vecOut->Z = f1 - f2;
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
void VectorNormaliseTo(VECTOR *vecOut, VECTOR *vecIn)
|
||||
{
|
||||
float fInv = 1.0f / (float)sqrt((double)(vecIn->X * vecIn->X + vecIn->Y * vecIn->Y +
|
||||
vecIn->Z * vecIn->Z));
|
||||
|
||||
vecOut->X = fInv * vecIn->X;
|
||||
vecOut->Y = fInv * vecIn->Y;
|
||||
vecOut->Z = fInv * vecIn->Z;
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
|
||||
@@ -101,6 +101,7 @@ const char* GetTaskNameFromTask(DWORD *task);
|
||||
int FUNC_100B4BC0(int a1, int a2, int a3); // .text:100B4BC0
|
||||
float FastSqrt(float x); // .text:100B5A60
|
||||
void VectorCrossProduct(VECTOR *vecOut, VECTOR *vec1, VECTOR *vec2); // .text:100B4C20
|
||||
void VectorNormaliseTo(VECTOR *vecOut, VECTOR *vecIn); // .text:100B4CC0
|
||||
void FUNC_100B5210(int a1, void *a2); // .text:100B5210, __cdecl: the caller's
|
||||
// stack cleanup is folded into the next call's argument setup
|
||||
|
||||
|
||||
Reference in New Issue
Block a user