Flock::Collision::Collider2D
A 2D collision shape attached to an entity, alongside a Flock::Transform2D
(which supplies world position + rotation). One component type for every
shape; shape selects how half/radius are read:
Circle -> radius
Box -> half = half-extents (x, y)
Capsule -> radius + half-height in half.y (segment along local Y)
layer/mask are bitfields for collision filtering; sensor reports
contacts (events) but is skipped by the resolver.
Constants
ALL_LAYERS = 4294967295_u32
Constructors
box(half_width : Number, half_height : Number, layer : UInt32 = ALL_LAYERS, mask : UInt32 = ALL_LAYERS, sensor : Bool = false) : Collider2D
Sourcecapsule(radius : Number, half_height : Number, layer : UInt32 = ALL_LAYERS, mask : UInt32 = ALL_LAYERS, sensor : Bool = false) : Collider2D
SourceClass methods
component_id
Instance methods
Do these two colliders' layer/mask bits permit a contact? (symmetric)
half
Sourcehalf=(half : Flock::Vec2)
Sourcelayer
Sourcemask
Sourceradius
Sourcesensor
Sourceshape
Sourceshape=(shape : Shape2D)
Source