xs_plane_3p
- Синтаксис
-
stock xs_plane_3p(Float:plane[], const Float:p1[], const Float:p2[], const Float:p3[]) { new Float:normalA[3], Float:normalB[3]; // normalA = Normalize(p3 - p1); normalA[0] = p3[0] - p1[0]; normalA[1] = p3[1] - p1[1]; normalA[2] = p3[2] - p1[2]; xs_vec_normalize(normalA, normalA); // normalB = Normalize(p3 - p2); normalB[0] = p3[0] - p2[0]; normalB[1] = p3[1] - p2[1]; normalB[2] = p3[2] - p2[2]; xs_vec_normalize(normalB, normalB); // plane normal = Normalize(normalA cross normalB) xs_vec_cross(normalA, normalB, plane); xs_vec_normalize(plane, plane); // plane shift distance = (-p1) dot plane normal new Float:__tmp[3]; xs_vec_neg(plane, __tmp); plane[XS_PLANE_D] = xs_vec_dot(__tmp, p1); }
Переменная | Описание |
---|---|
Нет агрументов |
- Описание
- This function has no description.