FixtureDefinition

class FixtureDefinition : FixtureDef

Box2D building DSL utility class. FixtureDef extension exposing new properties. Note that when using fixture builders from BodyDefinition, FixtureDefinition.shape field should not be modified - fixture's shape of the chosen type will already be set in the FixtureDefinition instance.

See also

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
var creationCallback: (Fixture) -> Unit?

Invoked after the Fixture is fully constructed.

Link copied to clipboard
Link copied to clipboard

If true, will dispose of FixtureDef.shape right after Fixture construction.

Link copied to clipboard
val filter: Filter
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var shape: Shape
Link copied to clipboard

Custom data object assigned to Fixture.getUserData. Allows to store additional data about the Fixture without having to override the class. Defaults to null.

Functions

Link copied to clipboard
fun FixtureDef.filter(filter: Filter): Filter

Utility extension method for setting up of FixtureDef.filter. Allows to copy an existing Filter instance to avoid copying each property manually.

inline fun FixtureDef.filter(init: Filter.() -> Unit)

Inlined utility extension method for setting up of FixtureDef.filter. Exposes Filter properties under this.

Link copied to clipboard
fun onCreate(callback: (Fixture) -> Unit)