X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fcollision.hpp;h=62f2145df414567058280585d0e51521082196cf;hb=20a94a721fdee25587d1698ff8cfd6d014b590f1;hp=d4f58825a5f3e2a0afdccc4a4f0170b35ab32c57;hpb=5b7f9214cb929399f1a855ef5807018a9447d510;p=supertux.git diff --git a/src/collision.hpp b/src/collision.hpp index d4f58825a..62f2145df 100644 --- a/src/collision.hpp +++ b/src/collision.hpp @@ -1,7 +1,7 @@ // $Id$ -// +// // SuperTux -// Copyright (C) 2005 Matthias Braun +// Copyright (C) 2006 Matthias Braun // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -12,12 +12,11 @@ // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA // 02111-1307, USA. - #ifndef __COLLISION_H__ #define __COLLISION_H__ @@ -29,6 +28,9 @@ class CollisionHit; class Collision { public: + /** checks if 2 rectangle intersect each other */ + static bool intersects(const Rect& r1, const Rect& r2); + /** does collision detection between 2 rectangles. Returns true in case of * collision and fills in the hit structure then. */ @@ -39,7 +41,7 @@ public: * Returns true in case of a collision and fills in the hit structure then. */ static bool rectangle_aatriangle(CollisionHit& hit, const Rect& rect, - const Vector& movement, const AATriangle& triangle); + const Vector& movement, const AATriangle& triangle); }; #endif