SoftBodyShape

The rest shape of a soft body: a ring of points in order, and a core inside it coreMass times heavier than a ring point. The coordinates are the shape's own, with y growing down; PhysicsWorld.softBody places it. Make one with semiDisc, circle or box.

toString gives its size, for example SoftBodyShape(ring=22, coreMass=34.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")

Types

Link copied to clipboard
object Companion

Builds the shapes soft bodies come in.

Properties

Link copied to clipboard

How many times heavier the core is than one ring point.

Link copied to clipboard

Number of points in the ring.

Functions

Link copied to clipboard
open override fun toString(): String