00001 /* Copyright (C) 2001 W.P. van Paassen - peter@paassen.tmfweb.nl 00002 00003 This program is free software; you can redistribute it and/or modify it under 00004 the terms of the GNU General Public License as published by the Free 00005 Software Foundation; either version 2 of the License, or (at your 00006 option) any later version. 00007 00008 This program is distributed in the hope that it will be useful, but WITHOUT 00009 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00010 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00011 for more details. 00012 00013 You should have received a copy of the GNU General Public License 00014 along with this program; see the file COPYING. If not, write to the Free 00015 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ 00016 00017 #ifndef WP_RAY2D_H 00018 #define WP_RAY2D_H 00019 00020 #include "WP_Def.h" 00021 #include "WP_Point2D.h" 00022 #include "WP_Vector2D.h" 00023 00024 namespace WPCG 00025 { 00026 class WP_Line2D; //forward declaration 00027 00046 class WP_Ray2D 00047 { 00048 public: 00049 WP_Ray2D(){}; 00050 00055 WP_Ray2D(const WP_Point2D& p, const WP_Vector2D& v); 00056 00060 WP_Ray2D(WP_Line2D& l); 00061 00062 ~WP_Ray2D(){}; 00063 00070 int intersection(const WP_Ray2D& r, WP_Point2D& p) const; 00071 00075 void draw() const; 00076 00080 WP_Point2D start; 00081 00085 WP_Vector2D direction; 00086 }; 00087 } 00088 #endif 00089