Exemple #1
0
        /**
         *  Return true if there is a collision
         */
        public bool intersectionTest()
        {
            if (this.Checker != null)
            {
                if (!this.Checker(this.Node1, this.Node2))
                {
                    return(false);
                }
            }

            Vector2 intersectionDepth = RectangleExtensions.GetIntersectionDepth(Node1.GetBoundingBox(), Node2.GetBoundingBox());

            if (intersectionDepth.LengthSquared() != 0)
            {
                return(boxAndBoxTest());
            }
            else
            {
                return(false);
            }
        }