Documentation
¶
Overview ¶
Package collide provides 2D swept / proximity hit tests.
Index ¶
- func CircleHitsCircle(ax, ay, ar, bx, by, br float64) bool
- func CircleHitsRect(cx, cy, radius, rx, ry, rw, rh float64) bool
- func ClosestHitAlongSegment(ax, ay, bx, by, hitRadius float64, ...) (id uint64, ok bool)
- func DistPointSegment(px, py, ax, ay, bx, by float64) float64
- func SegmentHitsCircle(ax, ay, bx, by, cx, cy, radius float64) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CircleHitsCircle ¶ added in v0.0.3
CircleHitsCircle reports whether two disks overlap (edges touching counts).
func CircleHitsRect ¶ added in v0.0.3
CircleHitsRect reports whether a disk overlaps an axis-aligned rectangle defined by top-left (rx,ry) and size (rw,rh).
func ClosestHitAlongSegment ¶
func ClosestHitAlongSegment(ax, ay, bx, by, hitRadius float64, each func(yield func(x, y float64, id uint64))) (id uint64, ok bool)
ClosestHitAlongSegment finds the candidate whose center is closest to segment AB among those within hitRadius. each should call yield(x, y, id) for every candidate. Returns the winning id.
func DistPointSegment ¶
DistPointSegment returns distance from P to the closest point on segment AB.
func SegmentHitsCircle ¶
SegmentHitsCircle reports whether segment AB comes within radius of (cx,cy).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.