CapsuleGeometry constructor

CapsuleGeometry({
  1. double radius = 1,
  2. double length = 1,
  3. int capSegments = 4,
  4. int radialSegments = 8,
})

Implementation

factory CapsuleGeometry({double radius = 1,double length = 1,int capSegments = 4,int radialSegments = 8 }) {
	final path = Path();
	path.absarc( 0, - length / 2, radius, math.pi * 1.5, 0 );
	path.absarc( 0, length / 2, radius, 0, math.pi * 0.5 );

    return CapsuleGeometry.create(path.getPoints( capSegments ) as List<Vector2>, radialSegments: radialSegments);
}