/// <inheritdoc /> public override bool RayCastSelf(ref RayCastData ray, out float distance, out Vector3 normal) { normal = Vector3.Up; // Check if skip raycasts if ((ray.Flags & RayCastData.FlagTypes.SkipEditorPrimitives) == RayCastData.FlagTypes.SkipEditorPrimitives) { distance = 0; return(false); } BoundingSphere sphere = new BoundingSphere(Transform.Translation, 7.0f); return(CollisionsHelper.RayIntersectsSphere(ref ray.Ray, ref sphere, out distance)); }
/// <summary> /// Determines if there is an intersection between the current object and a <see cref="BoundingSphere" />. /// </summary> /// <param name="sphere">The sphere to test.</param> /// <param name="point"> /// When the method completes, contains the point of intersection, /// or <see cref="Vector3.Zero" /> if there was no intersection. /// </param> /// <returns>Whether the two objects intersected.</returns> public bool Intersects(ref BoundingSphere sphere, out Vector3 point) { return(CollisionsHelper.RayIntersectsSphere(ref this, ref sphere, out point)); }
/// <summary> /// Determines if there is an intersection between the current object and a <see cref="BoundingSphere" />. /// </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 BoundingSphere sphere, out float distance) { return(CollisionsHelper.RayIntersectsSphere(ref this, ref sphere, out distance)); }
/// <summary> /// Determines if there is an intersection between the current object and a <see cref="Ray" />. /// </summary> /// <param name="ray">The ray to test.</param> /// <returns>Whether the two objects intersected.</returns> public bool Intersects(ref Ray ray) { float distance; return(CollisionsHelper.RayIntersectsSphere(ref ray, ref this, out distance)); }
/// <summary> /// Determines if there is an intersection between the current object and a <see cref="Ray" />. /// </summary> /// <param name="ray">The ray to test.</param> /// <param name="point"> /// When the method completes, contains the point of intersection, /// or <see cref="Vector3.Zero" /> if there was no intersection. /// </param> /// <returns>Whether the two objects intersected.</returns> public bool Intersects(ref Ray ray, out Vector3 point) { return(CollisionsHelper.RayIntersectsSphere(ref ray, ref this, out point)); }
/// <inheritdoc /> public override bool RayCastSelf(ref Ray ray, out float distance) { BoundingSphere sphere = new BoundingSphere(Transform.Translation, 7.0f); return(CollisionsHelper.RayIntersectsSphere(ref ray, ref sphere, out distance)); }