getSupport method
Get the supporting vertex index in the given direction.
Implementation
int getSupport(Vector2 d) {
var bestIndex = 0;
var bestValue = vertices[0].dot(d);
for (var i = 1; i < _count; i++) {
final value = vertices[i].dot(d);
if (value > bestValue) {
bestIndex = i;
bestValue = value;
}
}
return bestIndex;
}