public bool OnCollided(ICollisionBounds bounds0, ICollisionBounds bounds1)
        {
            var actor0 = bounds0.Entity as Actor;
            var actor1 = bounds1.Entity as Actor;

            if (actor0 is TerrainActor || actor1 is TerrainActor)
            {
                return true;
            }

            return false;
        }
Exemplo n.º 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;
        }
Exemplo n.º 3
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;
 }
Exemplo n.º 4
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;
        }
 public bool OnCollided(ICollisionBounds bounds0, ICollisionBounds bounds1)
 {
     return false;
 }