Exemple #1
0
        /// <summary>
        /// CapsuleCast helper method.
        /// </summary>
        /// <param name="bottom">The center of the sphere at the start of the capsule.</param>
        /// <param name="top">The center of the sphere at the end of the capsule.</param>
        /// <param name="radius">The radius of the sphere.</param>
        /// <param name="direction">The direction into which to sweep the sphere.</param>
        /// <param name="hitInfo">If true is returned, hitInfo will contain more information about where the collider was hit.</param>
        /// <param name="distance">The length of the cast.</param>
        /// <param name="backstepDistance">Probing backstep distance to avoid initial overlaps.</param>
        /// <returns>True when the intersects any 'ground' collider, otherwise false.</returns>

        protected bool CapsuleCast(Vector3 bottom, Vector3 top, float radius, Vector3 direction, out RaycastHit hitInfo,
                                   float distance, float backstepDistance = kBackstepDistance)
        {
            return(PhysicsCastHelper.CapsuleCast(bottom, top, radius, direction, out hitInfo, distance, groundMask,
                                                 triggerInteraction, backstepDistance));
        }
Exemple #2
0
 /// <summary>
 /// SphereCast helper method.
 /// </summary>
 /// <param name="origin">The center of the sphere at the start of the sweep.</param>
 /// <param name="radius">The radius of the sphere.</param>
 /// <param name="direction">The direction into which to sweep the sphere.</param>
 /// <param name="hitInfo">If true is returned, hitInfo will contain more information about where the collider was hit.</param>
 /// <param name="distance">The length of the cast.</param>
 /// <param name="backstepDistance">Probing backstep distance to avoid initial overlaps.</param>
 /// <returns>True when the intersects any 'ground' collider, otherwise false.</returns>
 protected bool SphereCast(Vector3 origin, float radius, Vector3 direction, out RaycastHit hitInfo,
                           float distance, float backstepDistance = kBackstepDistance)
 {
     return(PhysicsCastHelper.SphereCast(origin, radius, direction, out hitInfo, distance, groundMask,
                                         triggerInteraction, backstepDistance));
 }