コード例 #1
0
 /// <summary>
 /// By definition, Rays cannot contain anything.
 /// So this will always return false.
 /// </summary>
 /// <param name="collisionType"></param>
 /// <param name="other"></param>
 /// <param name="location"></param>
 /// <returns>False</returns>
 public bool Contains(BaseCollisionType collisionType, ICollisionBounds other, Vector2? location)
 {
     return false;
 }
コード例 #2
0
        public bool Intersects(BaseCollisionType collisionType, ICollisionBounds other)
        {
            if (other == null)
                return false;

            switch (collisionType)
            {
                case BaseCollisionType.Box:
                    return (IntersectsBox((CollisionBox)other) != null);

                case BaseCollisionType.Circle:
                    return (IntersectsCircle((CollisionCircle)other) != null);
            }

            return false;
        }
コード例 #3
0
        public bool Contains(BaseCollisionType collisionType, ICollisionBounds other, Vector2? location)
        {
            switch (collisionType)
            {
                case BaseCollisionType.Box:
                    if (other != null)
                        return ContainsBox((CollisionBox)other);
                    else
                        return false;

                case BaseCollisionType.Circle:
                    if (other != null)
                        return ContainsCircle((CollisionCircle)other);
                    else
                        return false;

                case BaseCollisionType.Point:
                    if (location != null)
                        return ContainsPoint((Vector2)location);
                    else
                        return false;
            }

            //If all else fails, return false.
            return false;
        }