コード例 #1
0
        /// <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));
        }
コード例 #2
0
 /// <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));
 }
コード例 #3
0
 /// <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));
 }
コード例 #4
0
        /// <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));
        }
コード例 #5
0
 /// <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));
 }
コード例 #6
0
ファイル: ActorNodeWithIcon.cs プロジェクト: djlw78/FlaxAPI
        /// <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));
        }