/// <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); }
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); } }
void OverlappingAABB(aabbCollision other) { isOverlapping = true; }
static public void Add(aabbCollision obj) { aabbs.Add(obj); }
static public void Remove(aabbCollision obj) { aabbs.Remove(obj); //print("there are " + aabbs.Count + " AABBS registered."); }