FarseerPhysics.Common.PolygonTools.createCapsule C# (CSharp) Method

createCapsule() public static method

Creates an capsule with the specified height, radius and number of edges. A capsule has the same form as a pill capsule.
public static createCapsule ( float height, float endRadius, int edges ) : Vertices
height float Height (inner height + 2 * radius) of the capsule.
endRadius float Radius of the capsule ends.
edges int The number of edges of the capsule ends. The more edges, the more it resembles an capsule
return Vertices
		public static Vertices createCapsule( float height, float endRadius, int edges )
		{
			if( endRadius >= height / 2 )
				throw new ArgumentException(
					"The radius must be lower than height / 2. Higher values of radius would create a circle, and not a half circle.",
nameof( endRadius ) );

			return createCapsule( height, endRadius, edges, endRadius, edges );
		}

Same methods

PolygonTools::createCapsule ( float height, float topRadius, int topEdges, float bottomRadius, int bottomEdges ) : Vertices