xs_anglevectors
- Синтаксис
-
// Compute forward, right and up vector from angles // half-tested // angle indexes #define XS_PITCH 0 // up / down #define XS_YAW 1 // left / right #define XS_ROLL 2 // fall over stock xs_anglevectors(const Float:angles[3], Float:fwd[3], Float:right[3], Float:up[3]) { // sin (s) and cos (c) for yaw (y), pitch (p) and roll (r) new Float:sr, Float:sp, Float:sy, Float:cr, Float:cp, Float:cy; sy = xs_sin(angles[XS_YAW], degrees); cy = xs_cos(angles[XS_YAW], degrees); sp = xs_sin(angles[XS_PITCH], degrees); cp = xs_cos(angles[XS_PITCH], degrees); sr = xs_sin(angles[XS_ROLL], degrees); cr = xs_cos(angles[XS_ROLL], degrees); fwd[0] = cp*cy; fwd[1] = cp*sy; fwd[2] = -sp; right[0] = (-1*sr*sp*cy + -1*cr*-sy); right[1] = (-1*sr*sp*sy + -1*cr*cy); right[2] = -1*sr*cp; up[0] = (cr*sp*cy + -sr*-sy); up[1] = (cr*sp*sy + -sr*cy); up[2] = cr*cp; }
Переменная | Описание |
---|---|
Нет агрументов |
- Описание
- **** HL ENGINE SPECIFIC STUFF *****