DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ DistSqrPoint2Line()

float ActionTargets::DistSqrPoint2Line ( vector pPoint,
vector pL1,
vector pL2 )
inlineprivate

distance between point and line

См. определение в файле ActionTargets.c строка 452

453 {
454 vector v = pL2 - pL1;
455 vector w = pPoint - pL1;
456
457 float c1 = vector.Dot(w,v);
458 float c2 = vector.Dot(v,v);
459
460 if ( c1 <= 0 || c2 == 0 )
461 return vector.DistanceSq(pPoint, pL1);
462
463 float b = c1 / c2;
464 vector nearestPoint = pL1 + (v * b);
465 return vector.DistanceSq(pPoint, nearestPoint);
466 }
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
Определения EnConvert.c:271

Перекрестные ссылки vector::DistanceSq() и vector::Dot().

Используется в ComputeUtility().