extractCollisionShapes
extractCollisionShapes(
map,objectLayerName?):TilemapColliderConfig[]
Defined in: tilemap/src/colliders.ts:26
Extract physics-agnostic collision shapes from object layers.
- Rectangle objects -> RectColliderConfig
- Ellipse objects (width === height) -> CircleColliderConfig
- Ellipse objects (width !== height) -> CircleColliderConfig with the wider radius (Rapier has no real ellipse primitive), with a dev warning
- Capsule objects -> CapsuleColliderConfig oriented along the longer axis
- Polygon objects -> PolylineColliderConfig (Tiled polygons are authored as outlines and may be concave; static-only)
- Point objects -> skipped (not collision shapes)
Parameters
Section titled “Parameters”Generic TilemapData.
objectLayerName?
Section titled “objectLayerName?”string
Optional: only extract from this layer.