semiDisc

fun semiDisc(radius: Float, arcSegments: Int, baseSegments: Int, coreMass: Float, heightScale: Float = 1.0f): SoftBodyShape(source)

Returns a slime: a half-disc of radius, arcSegments segments over the dome from the left end to the right, then baseSegments along the flat base back, with the dome stretched heightScale times taller and the core where the half-disc's centre of mass is. Pass the arguments by name.

Throws

if radius is not more than 0, there are fewer than 2 arc or 1 base segments, or coreMass is not more than 0.

Samples

// A slime: a dome 13 units round, its ring of 22 points, its core 34 times a ring point's mass.
val slime = SoftBodyShape.semiDisc(radius = 13f, arcSegments = 14, baseSegments = 8, coreMass = 34f, heightScale = 1.3f)
assertPrints(slime, "SoftBodyShape(ring=22, coreMass=34.0)")
val ball = SoftBodyShape.circle(radius = 10f, segments = 16, coreMass = 4f)
assertPrints(ball.ringCount, "16")