Companion

Builds the shapes soft bodies come in.

Functions

Link copied to clipboard
fun box(width: Float, height: Float, across: Int, down: Int, coreMass: Float): SoftBodyShape

Returns a box width by height, its ring across segments along the top and bottom and down along each side, with the core in the middle. Pass the counts by name.

Link copied to clipboard
fun circle(radius: Float, segments: Int, coreMass: Float): SoftBodyShape

Returns a ball: segments points around a circle of radius, with the core in the middle.

Link copied to clipboard
fun semiDisc(radius: Float, arcSegments: Int, baseSegments: Int, coreMass: Float, heightScale: Float = 1.0f): SoftBodyShape

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.