public static int OverlapSphereNonAlloc(SphereCollider sphere, Collider[] results, int layerMask = Physics.DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal) { Vector3 center; float radius; sphere.ToWorldSpaceSphere(out center, out radius); return(Physics.OverlapSphereNonAlloc(center, radius, results, layerMask, queryTriggerInteraction)); }
public static int SphereCastNonAlloc(SphereCollider sphere, Vector3 direction, RaycastHit[] results, float maxDistance = Mathf.Infinity, int layerMask = Physics.DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal) { Vector3 center; float radius; sphere.ToWorldSpaceSphere(out center, out radius); return(Physics.SphereCastNonAlloc(center, radius, direction, results, maxDistance, layerMask, queryTriggerInteraction)); }
public static bool CheckSphere(SphereCollider sphere, int layerMask = Physics.DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal) { Vector3 center; float radius; sphere.ToWorldSpaceSphere(out center, out radius); return(Physics.CheckSphere(center, radius, layerMask, queryTriggerInteraction)); }
public static Collider[] OverlapSphere (SphereCollider sphere, int layerMask = Physics.DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal, float expandBy = 0.0f) { Vector3 center; float radius; sphere.ToWorldSpaceSphere(out center, out radius); radius += expandBy; return(Physics.OverlapSphere(center, radius, layerMask, queryTriggerInteraction)); }