Box2DX.Collision.PolygonShape.Support C# (CSharp) Метод

Support() публичный Метод

Get the support point in the given world direction. Use the supplied transform.
public Support ( XForm xf, Vec2 d ) : Vec2
xf Box2DX.Common.XForm
d Box2DX.Common.Vec2
Результат Box2DX.Common.Vec2
		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]);
		}