edge

inline fun BodyDefinition.edge(from: Vector2, to: Vector2, init: FixtureDefinition.(EdgeShape) -> Unit = {}): FixtureDefinition

Utility builder method for constructing fixtures with EdgeShape.

Return

FixtureDefinition with Fixture properties.

Parameters

from

first point of the EdgeShape. See EdgeShape.getVertex1.

to

second point of the EdgeShape. See EdgeShape.getVertex2.

init

inlined. Allows to modify FixtureDef properties. Receives EdgeShape as first (it) argument.

See also

EdgeShape.set

inline fun BodyDefinition.edge(fromX: Float, fromY: Float, toX: Float, toY: Float, init: FixtureDefinition.(EdgeShape) -> Unit = {}): FixtureDefinition

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.

Return

FixtureDefinition with Fixture properties.

Parameters

fromX

position of first point of the EdgeShape on X axis. See EdgeShape.getVertex1.

fromY

position of first point of the EdgeShape on Y axis. See EdgeShape.getVertex1.

toX

position of second point of the EdgeShape on X axis. See EdgeShape.getVertex2.

toY

position of second point of the EdgeShape on Y axis. See EdgeShape.getVertex2.

init

inlined. Allows to modify FixtureDef properties. Receives EdgeShape as first (it) argument.

See also

EdgeShape.set

inline fun Body.edge(from: Vector2, to: Vector2, init: FixtureDefinition.(EdgeShape) -> Unit = {}): Fixture

Utility builder method for constructing fixtures with EdgeShape.

Return

a fully constructed Fixture with EdgeShape.

Parameters

from

first point of the EdgeShape. See EdgeShape.getVertex1.

to

second point of the EdgeShape. See EdgeShape.getVertex2.

init

inlined. Allows to modify FixtureDef properties. Receives EdgeShape as first (it) argument.

See also

EdgeShape.set

inline fun Body.edge(fromX: Float, fromY: Float, toX: Float, toY: Float, init: FixtureDefinition.(EdgeShape) -> Unit = {}): Fixture

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.

Return

a fully constructed Fixture with EdgeShape.

Parameters

fromX

position of first point of the EdgeShape on X axis. See EdgeShape.getVertex1.

fromY

position of first point of the EdgeShape on Y axis. See EdgeShape.getVertex1.

toX

position of second point of the EdgeShape on X axis. See EdgeShape.getVertex2.

toY

position of second point of the EdgeShape on Y axis. See EdgeShape.getVertex2.

init

inlined. Allows to modify FixtureDef properties. Receives EdgeShape as first (it) argument.

See also

EdgeShape.set