Panda3D
|
00001 // Filename: eggMakeTube.h 00002 // Created by: drose (01Oct03) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef EGGMAKETUBE_H 00016 #define EGGMAKETUBE_H 00017 00018 #include "pandatoolbase.h" 00019 00020 #include "eggMakeSomething.h" 00021 00022 class EggGroup; 00023 class EggVertexPool; 00024 class EggVertex; 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Class : EggMakeTube 00028 // Description : A program to generate an egg file representing a tube 00029 // model, similar in shape to a CollisionTube. 00030 //////////////////////////////////////////////////////////////////// 00031 class EggMakeTube : public EggMakeSomething { 00032 public: 00033 EggMakeTube(); 00034 00035 void run(); 00036 00037 private: 00038 EggVertex *calc_sphere1_vertex(int ri, int si); 00039 EggVertex *calc_sphere2_vertex(int ri, int si); 00040 EggVertex *calc_tube_vertex(int ri, int si); 00041 void add_polygon(EggVertex *a, EggVertex *b, EggVertex *c, EggVertex *d); 00042 00043 private: 00044 double _point_a[3]; 00045 double _point_b[3]; 00046 bool _got_point_b; 00047 double _radius; 00048 int _num_slices; 00049 int _num_crings; 00050 int _num_trings; 00051 00052 double _length; 00053 EggGroup *_group; 00054 EggVertexPool *_vpool; 00055 }; 00056 00057 #endif 00058