public Vec2 Support(XForm xf, Vec2 d)
{
Vec2 dLocal = Common.Math.MulT(xf.R, d);
int bestIndex = 0;
float bestValue = Vec2.Dot(_coreVertices[0], dLocal);
for (int i = 1; i < _vertexCount; ++i)
{
float value = Vec2.Dot(_coreVertices[i], dLocal);
if (value > bestValue)
{
bestIndex = i;
bestValue = value;
}
}
return Common.Math.Mul(xf, _coreVertices[bestIndex]);
}