public GetLocalExtremePointWithoutMargin ( System.Vector3 &direction, System.Vector3 &extremePoint ) : void | ||
direction | System.Vector3 | Direction to find the extreme point in. |
extremePoint | System.Vector3 | Extreme point on the shape. |
return | void |
public override void GetLocalExtremePointWithoutMargin(ref Vector3 direction, out Vector3 extremePoint)
{
float dotA, dotB, dotC;
Vector3.Dot(ref direction, ref vA, out dotA);
Vector3.Dot(ref direction, ref vB, out dotB);
Vector3.Dot(ref direction, ref vC, out dotC);
if (dotA > dotB && dotA > dotC)
{
extremePoint = vA;
}
else if (dotB > dotC) //vA is not the most extreme point.
{
extremePoint = vB;
}
else
{
extremePoint = vC;
}
}