示例#1
0
        public bool Collide(Vector2 point)
        {
            Feature feature;

            point = Vector2.Transform(point, MatrixInverse);
            grid.Intersect(ref point, out feature);
            if (feature.Distance < 0)
            {
                return(true);
            }
            return(false);
        }
示例#2
0
        /// <summary>
        /// Checks to see if the geom collides with the specified point.
        /// </summary>
        /// <param name="point">The point.</param>
        /// <returns>true if colliding</returns>
        public bool Collide(Vector2 point)
        {
            //TODO: Don't check collision if it's disabled?
            Feature feature;

            point = Vector2.Transform(point, MatrixInverse);

            //NOTE: Could use the boolean returned by the Intersect methods instead?
            // feature.Distance < 0, should this be <= 0?
            grid.Intersect(ref point, out feature);
            if (feature.Distance < 0)
            {
                return(true);
            }
            return(false);
        }