Ejemplo n.º 1
0
    /// <summary>
    /// Checks to see if some other AABB overlaps this AABB.
    /// </summary>
    /// <param name="other">The AABB component to check against.</param>
    /// <returns></returns> if True, the two AABBs overlap.
    ///
    public bool CheckOverlap(aabbCollision other)
    {
        if (other.bounds.min.x > this.bounds.max.x)
        {
            return(false);
        }
        if (other.bounds.max.x < this.bounds.min.x)
        {
            return(false);
        }

        if (other.bounds.min.y > this.bounds.max.y)
        {
            return(false);
        }
        if (other.bounds.max.y < this.bounds.min.y)
        {
            return(false);
        }

        if (other.bounds.min.z > this.bounds.max.z)
        {
            return(false);
        }
        if (other.bounds.max.z < this.bounds.min.z)
        {
            return(false);
        }


        return(true);
    }
Ejemplo n.º 2
0
    void OverlappingAABB(aabbCollision other)
    {
        if (other.tag == "Powerup")
        {
            // it must be a powerup...
            PowerUps powerup = other.GetComponent <PowerUps>();
            switch (powerup.type)
            {
            case PowerUps.Type.None:
                break;

            case PowerUps.Type.Slowmo:
                break;

            case PowerUps.Type.Health:
                break;

            case PowerUps.Type.JetpackBoost:
                break;
            }
            Destroy(other.gameObject);
        }
    }
Ejemplo n.º 3
0
 void OverlappingAABB(aabbCollision other)
 {
     isOverlapping = true;
 }
Ejemplo n.º 4
0
 static public void Add(aabbCollision obj)
 {
     aabbs.Add(obj);
 }
Ejemplo n.º 5
0
 static public void Remove(aabbCollision obj)
 {
     aabbs.Remove(obj);
     //print("there are " + aabbs.Count + " AABBS registered.");
 }