Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages
segment.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 2000 by Jorrit Tyberghein 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public 00015 License along with this library; if not, write to the Free 00016 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 */ 00018 00019 #ifndef __CS_SEGMENT_H__ 00020 #define __CS_SEGMENT_H__ 00021 00028 #include "csextern.h" 00029 00030 #include "csgeom/vector2.h" 00031 #include "csgeom/vector3.h" 00032 00036 class csSegment2 00037 { 00038 private: 00040 csVector2 start; 00042 csVector2 end; 00043 00044 public: 00046 csSegment2 (const csVector2& s, const csVector2& e) { start = s; end = e; } 00048 csSegment2 () { } 00050 ~csSegment2 () { } 00051 00053 inline void Set (const csVector2& s, const csVector2& e) 00054 { start = s; end = e; } 00055 00057 inline void SetStart (const csVector2& s) { start = s; } 00058 00060 inline void SetEnd (const csVector2& e) { end = e; } 00061 00063 inline const csVector2& Start () const { return start; } 00064 00066 inline const csVector2& End () const { return end; } 00067 00069 inline csVector2& Start () { return start; } 00070 00072 inline csVector2& End () { return end; } 00073 }; 00074 00078 class csSegment3 00079 { 00080 private: 00082 csVector3 start; 00084 csVector3 end; 00085 00086 public: 00088 csSegment3 (const csVector3& s, const csVector3& e) { start = s; end = e; } 00090 csSegment3 () { } 00091 00093 inline void Set (const csVector3& s, const csVector3& e) 00094 { start = s; end = e; } 00095 00097 inline void SetStart (const csVector3& s) { start = s; } 00098 00100 inline void SetEnd (const csVector3& e) { end = e; } 00101 00103 inline const csVector3& Start () const { return start; } 00104 00106 inline const csVector3& End () const { return end; } 00107 00109 inline csVector3& Start () { return start; } 00110 00112 inline csVector3& End () { return end; } 00113 }; 00114 00117 #endif // __CS_SEGMENT_H__
Generated for Crystal Space by doxygen 1.4.4