예제 #1
0
 /// <summary>
 /// The BoxCast method is used to generate a boxcast either from the given CustomRaycast object or a default Physics.BoxCast.
 /// </summary>
 /// <param name="customCast">The optional object with customised cast parameters.</param>
 /// <param name="center">The center of the box.</param>
 /// <param name="halfExtents">Half the size of the box in each dimension.</param>
 /// <param name="direction">The direction in which to cast the box.</param>
 /// <param name="orientation">The rotation of the box.</param>
 /// <param name="maxDistance">The max length of the cast.</param>
 /// <param name="hitData">The boxcast hit data.</param>
 /// <param name="ignoreLayers">A layermask of layers to ignore from the boxcast.</param>
 /// <param name="affectTriggers">Determines the trigger interaction level of the cast.</param>
 /// <returns>Returns true if the boxcast successfully collides with a valid object.</returns>
 public static bool BoxCast(VRTK_CustomRaycast customCast, Vector3 center, Vector3 halfExtents, Vector3 direction, Quaternion orientation, float maxDistance, out RaycastHit hitData, LayerMask ignoreLayers, QueryTriggerInteraction affectTriggers = QueryTriggerInteraction.UseGlobal)
 {
     if (customCast != null)
     {
         return(customCast.CustomBoxCast(center, halfExtents, direction, orientation, maxDistance, out hitData));
     }
     else
     {
         return(Physics.BoxCast(center, halfExtents, direction, out hitData, orientation, maxDistance, ~ignoreLayers, affectTriggers));
     }
 }