public BoundingBox(BoundingBox copy, WorldObject holder) { IsActive = true; BaseLeft = copy.BaseLeft; BaseTop = copy.BaseTop; BaseRight = copy.BaseRight; BaseBottom = copy.BaseBottom; BaseZ = copy.BaseZ; Holder = holder; }
public Boolean BoundingBoxTest(BoundingBox testBB, Vector2f offset) { if (!IsActive || !testBB.IsActive) return false; if (Z != testBB.Z) return false; if (Holder == testBB.Holder) return false; if (this == testBB) return false; return !(Left + offset.X >= testBB.Right || Right + offset.X <= testBB.Left || Top + offset.Y >= testBB.Bottom || Bottom + offset.Y <= testBB.Top); }
public Boolean BoundingBoxTest(BoundingBox testBB) { if (!IsActive || !testBB.IsActive) return false; if (Z != testBB.Z) return false; if (Holder == testBB.Holder) return false; if (this == testBB) return false; return !(Left >= testBB.Right || Right <= testBB.Left || Top >= testBB.Bottom || Bottom <= testBB.Top); }