Garry's Mod Wiki

util.IsBoxIntersectingSphere

  boolean util.IsBoxIntersectingSphere( Vector boxMin, Vector boxMax, Vector shpere2Position, number sphere2Radius )

Description

Performs a box-sphere intersection and returns whether there was an intersection or not.

Arguments

1 Vector boxMin
The minimum extents of the Axis-Aligned box.
2 Vector boxMax
The maximum extents of the Axis-Aligned box.
3 Vector shpere2Position
Any position of the sphere.
4 number sphere2Radius
The radius of the sphere.

Returns

1 boolean
true if there is an intersection, false otherwise.