Package-level declarations

Types

Link copied to clipboard
data class Capsule(val center1: Vec2, val center2: Vec2, val radius: Float)

A solid capsule shape geometry. A capsule is two semicircles connected by a rectangle.

Link copied to clipboard
expect class Chain

A chain shape is a series of connected line segments. Chains can be used for static geometry like terrain or for dynamic chains.

Link copied to clipboard
data class ChainDef(val points: List<Vec2>, val isLoop: Boolean = false, val materials: List<SurfaceMaterial>? = null, val filter: Filter = Filter.Default, val enableSensorEvents: Boolean = false)

Definition for creating a chain shape.

Link copied to clipboard
data class ChainSegment(val ghost1: Vec2, val segment: Segment, val ghost2: Vec2, val chainId: Int)

A chain segment with ghost vertices for smooth collision.

Link copied to clipboard
data class Circle(val center: Vec2 = Vec2.Zero, val radius: Float)

A solid circle shape geometry.

Link copied to clipboard
data class Filter(val categoryBits: ULong = B2_DEFAULT_CATEGORY_BITS, val maskBits: ULong = B2_DEFAULT_MASK_BITS, val groupIndex: Int = 0)

Collision filtering data.

Link copied to clipboard
data class Polygon(val vertices: List<Vec2>, val radius: Float = 0.0f)

A solid convex polygon shape geometry.

Link copied to clipboard
data class Segment(val point1: Vec2, val point2: Vec2)

A line segment shape geometry.

Link copied to clipboard
expect class Shape

A shape attached to a body. Shapes define the collision geometry and physical properties.

Link copied to clipboard
data class ShapeDef(val density: Float = 1.0f, val friction: Float = 0.6f, val restitution: Float = 0.0f, val rollingResistance: Float = 0.0f, val tangentSpeed: Float = 0.0f, val filter: Filter = Filter.Default, val isSensor: Boolean = false, val enableSensorEvents: Boolean = false, val enableContactEvents: Boolean = false, val enableHitEvents: Boolean = false, val enablePreSolveEvents: Boolean = false, val invokeContactCreation: Boolean = true, val updateBodyMass: Boolean = true)

Definition for creating a shape. Default values match Box2D's b2DefaultShapeDef().

Link copied to clipboard

Shape types supported by Box2D.

Link copied to clipboard
data class SurfaceMaterial(val friction: Float = 0.6f, val restitution: Float = 0.0f, val rollingResistance: Float = 0.0f, val tangentSpeed: Float = 0.0f, val userMaterialId: Int = 0, val customColor: UInt)

Surface material properties for shapes. Controls friction, restitution, and other surface interaction parameters.