struct

Flock::Collision::OBB

Inherits Struct < Value < Object

Internal oriented bounding box (center, half-extents, unit axes) used by the 2D narrowphase for rotated-box tests. Not part of the public API.

Constructors

new(c : Flock::Vec2, h : Flock::Vec2, rotation : Float32)
Source

Instance methods

corner(sx : Float32, sy : Float32) : Flock::Vec2
Source
dir_to_world(local : Flock::Vec2) : Flock::Vec2

Box-local direction -> world direction (rotation only, no translation).

Source
project_radius(n : Flock::Vec2) : Float32

Support radius of the box projected onto unit axis n (half-width of the box's shadow on that axis).

Source
support(dir : Flock::Vec2) : Flock::Vec2

The corner most aligned with dir (the support point in that direction).

Source
to_local(p : Flock::Vec2) : Flock::Vec2

World point -> box-local coordinates (along ux, uy).

Source
to_world(local : Flock::Vec2) : Flock::Vec2

Box-local coordinates -> world point.

Source