Garry's Mod Wiki

Revision Difference

ents.FindInSphere#563614

<function name="FindInSphere" parent="ents" type="libraryfunc"> <description> Gets all entities within the specified sphere. ⤶ Serverside, this uses a Spatial Partition internally to avoid looping through all entities, so it is more efficient than using <page>ents.GetAll</page> for this purpose. ⤶ Clientside, this function internally calls <page>util.IsBoxIntersectingSphere</page>⤶ ⤶ This function internally calls <page>util.IsBoxIntersectingSphere</page> for every entity on the map based on their Orientated Bounding Box. </description> <realm>Shared</realm> <args> <arg name="origin" type="Vector">Center of the sphere.</arg> <arg name="radius" type="number">Radius of the sphere.</arg> </args> <rets> <ret name="" type="table<Entity>">A table of all found <page>Entity</page>s.</ret> </rets> </function>