Example #1
0
        /// <summary>
        /// Determines if there is an intersection between the current object and a <see cref="MyRay"/>.
        /// </summary>
        /// <param name="ray">The ray to test.</param>
        /// <returns>Whether the two objects intersected.</returns>
        public bool Intersects(ref MyRay ray)
        {
            float distance;

            return(MyCollision.RayIntersectsSphere(ref ray, ref this, out distance));
        }
Example #2
0
 /// <summary>
 /// Determines if there is an intersection between the current object and a <see cref="MyBoundingSphere"/>.
 /// </summary>
 /// <param name="sphere">The sphere to test.</param>
 /// <param name="point">When the method completes, contains the point of intersection,
 /// or <see cref="MyVector3.Zero"/> if there was no intersection.</param>
 /// <returns>Whether the two objects intersected.</returns>
 public bool Intersects(ref MyBoundingSphere sphere, out MyVector3 point)
 {
     return(MyCollision.RayIntersectsSphere(ref this, ref sphere, out point));
 }
Example #3
0
 /// <summary>
 /// Determines if there is an intersection between the current object and a <see cref="MyRay"/>.
 /// </summary>
 /// <param name="ray">The ray to test.</param>
 /// <param name="point">When the method completes, contains the point of intersection,
 /// or <see cref="MyVector3.Zero"/> if there was no intersection.</param>
 /// <returns>Whether the two objects intersected.</returns>
 public bool Intersects(ref MyRay ray, out MyVector3 point)
 {
     return(MyCollision.RayIntersectsSphere(ref ray, ref this, out point));
 }
Example #4
0
 /// <summary>
 /// Determines if there is an intersection between the current object and a <see cref="MyBoundingSphere"/>.
 /// </summary>
 /// <param name="sphere">The sphere to test.</param>
 /// <param name="distance">When the method completes, contains the distance of the intersection,
 /// or 0 if there was no intersection.</param>
 /// <returns>Whether the two objects intersected.</returns>
 public bool Intersects(ref MyBoundingSphere sphere, out float distance)
 {
     return(MyCollision.RayIntersectsSphere(ref this, ref sphere, out distance));
 }