Glare.Box4i.Intersect C# (CSharp) Method

Intersect() public method

Get the intersection type between this box and the point.
public Intersect ( Vector4i point ) : Containment
point Vector4i
return Containment
        public Containment Intersect( Vector4i point)
        {
            // Most points should be outside, so check that first.
                if ( point.X < Min.X || point.X > Max.X || point.Y < Min.Y || point.Y > Max.Y || point.Z < Min.Z || point.Z > Max.Z || point.W < Min.W || point.W > Max.W )
                    return Containment.Disjoint;
                // Now check for boundaries, which will usually be cut short on the first axis.
                if ( (point.X == Min.X || point.X == Max.X) && (point.Y == Min.Y || point.Y == Max.Y) && (point.Z == Min.Z || point.Z == Max.Z) && (point.W == Min.W || point.W == Max.W) )
                    return Containment.Intersects;
                return Containment.Contains;
        }