BodyDefinition
Box2D building DSL utility class. BodyDef extension storing FixtureDef instances in fixtureDefinitions collection. Provides inlined building methods that construct fixture definitions.
See also
Properties
Invoked after the Body is fully constructed.
Stores FixtureDefinition instances of all currently defined fixtures of this body. Should not be modified manually - instead, use fixture or one of building methods for fixtures of a specific shape.
Functions
Utility builder method for constructing fixtures with PolygonShape set as box. Note that - contrary to PolygonShape.setAsBox methods - this method consumes actual not halved box width and height sizes.
Utility builder method for constructing fixtures with ChainShape.
Utility builder method for constructing fixtures with ChainShape. Note that this method consumes a FloatArray instead of array of Vector2 instances, which might be less readable, but creates slightly less garbage. This method is advised to be used instead of the Vector2-consuming variant on mobile devices.
Utility builder method for constructing fixtures with CircleShape.
Utility builder method for constructing fixtures with EdgeShape.
Utility builder method for constructing fixtures with EdgeShape. Note that this method consumes floats instead of Vector2 instances, which might be less concise, but also creates slightly less garbage. This method is advised to be used instead of the Vector2-consuming variant on mobile devices.
Utility builder method for constructing fixtures of custom shape type.
Utility builder method for constructing fixtures with looped ChainShape.
Utility builder method for constructing fixtures with looped ChainShape. Note that this method consumes a FloatArray instead of array of Vector2 instances, which might be less readable, but creates slightly less garbage. This method is advised to be used instead of the Vector2-consuming variant on mobile devices.
Utility builder method for constructing fixtures with PolygonShape.
Utility builder method for constructing fixtures with PolygonShape. Note that this method consumes a FloatArray instead of array of Vector2 instances, which might be less readable, but creates slightly less garbage. This method is advised to be used instead of the Vector2-consuming variant on mobile devices.