DistanceToPoint returns the distance from this box to the specified point.
(point *Vector2)
| 188 | |
| 189 | // DistanceToPoint returns the distance from this box to the specified point. |
| 190 | func (b *Box2) DistanceToPoint(point *Vector2) float32 { |
| 191 | |
| 192 | v1 := NewVector2(0, 0) |
| 193 | clampedPoint := v1.Copy(point).Clamp(&b.min, &b.max) |
| 194 | return clampedPoint.Sub(point).Length() |
| 195 | } |
| 196 | |
| 197 | // Intersect sets this box to the intersection with other box. |
| 198 | // Returns pointer to this updated bounding box. |
nothing calls this directly
no test coverage detected