AMX Mod X API Documentation

Signature
stock xs_vec_normalize(const Float:vec[], Float:out[]){ new Float:invlen = xs_rsqrt(vec[0]*vec[0] + vec[1]*vec[1] + vec[2]*vec[2]); out[0] = vec[0] * invlen; out[1] = vec[1] * invlen; out[2] = vec[2] * invlen;}
Description

Normalizes a vector. Normalized vector is a vector with the length of 1 unit,

but with the same direction as the original vector.

Parameters
  • vec The vector to be normalized.
  • out The output vector. Can be the same as the input vector.
No return value
Назад
Верх