Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

path.h

Go to the documentation of this file.
00001 // OMICRON ENGINE HEADER FILE
00002 //
00003 // --------------------------------------------------------------------------
00004 // Copyright (C) 2001-2002 by Bjoern Paetzel <kolrabi@gmx.de>
00005 //
00006 // This file is part of the Omicron Engine.
00007 //
00008 // The Omicron Engine is free software; you can redistribute it and/or modify
00009 // it under the terms of the  GNU General Public License  as published by the
00010 // Free Software Foundation;  either version  2  of the License,  or (at your
00011 // option) any later version.
00012 //
00013 // The Omicron Engine  is distributed in the hope that it will be useful, but
00014 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00015 // or  FITNESS FOR A PARTICULAR PURPOSE.  See the  GNU General Public License
00016 // for more details.
00017 //
00018 // You should have  received a copy of the  GNU General Public License  along
00019 // with The Omicron Engine;  if not,  write to the  Free Software Foundation,
00020 // Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
00021 //
00022 // --------------------------------------------------------------------------
00023 // Last modified:       $Date: 2002/12/07 19:02:17 $
00024 // By           :       $Author: kolrabi $
00025 // $Id: path.h,v 1.1.1.1 2002/12/07 19:02:17 kolrabi Exp $ 
00026 
00027 /*
00028 
00029   $Log: path.h,v $
00030   Revision 1.1.1.1  2002/12/07 19:02:17  kolrabi
00031   initial release
00032 
00033 
00034 */
00035 
00043 #include            "vector.h" 
00044 #include            "list.h" 
00045 
00046 #ifndef             OMICRON_TYPES_PATH_DEFINED 
00047 #define             OMICRON_TYPES_PATH_DEFINED 
00048 
00049 class path_c 
00051 {
00052 protected:
00053 
00054     struct node_s                       
00055     { 
00056         vec3_c      pos;                
00057         float       frac;               
00058     }; 
00059 
00060     list_c <node_s> *nodes;             
00061     bool            closed;             
00062  
00063     float           lengthfactor; 
00064  
00065 public: 
00066  
00067     // c'tor & d'tor 
00068     path_c(); 
00069     virtual ~path_c(); 
00070 
00071     void                                
00072     add_node(float frac, vec3_t pos);
00073 
00074     // 
00075     slong                               
00076     get_node_num(float);                
00077 
00078     node_s *                            
00079     get_node(slong); 
00080 
00081     vec3_c                              
00082     get_pos(float frac); 
00083 
00084     void                                
00085     set_closed(bool b) 
00086     {
00087         AssertThis;
00088         closed = b?1:0;
00089     };
00090 
00091     void                                
00092     set_length(float f)
00093     {
00094         AssertThis;
00095         AssertReturn1(f);
00096 
00097         lengthfactor = 1/f;
00098     }
00099 
00100     slong                               
00101     get_count()
00102     {
00103         AssertThisValue(INVALID_INDEX);
00104         return nodes->get_count();
00105     }
00106 
00107 };
00108 
00109 #endif
00110 

Generated on Wed Dec 18 15:48:47 2002 for omicron engine by doxygen1.2.18