Panda3D
eggMakeTube.h
1 // Filename: eggMakeTube.h
2 // Created by: drose (01Oct03)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef EGGMAKETUBE_H
16 #define EGGMAKETUBE_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "eggMakeSomething.h"
21 
22 class EggGroup;
23 class EggVertexPool;
24 class EggVertex;
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : EggMakeTube
28 // Description : A program to generate an egg file representing a tube
29 // model, similar in shape to a CollisionTube.
30 ////////////////////////////////////////////////////////////////////
31 class EggMakeTube : public EggMakeSomething {
32 public:
33  EggMakeTube();
34 
35  void run();
36 
37 private:
38  EggVertex *calc_sphere1_vertex(int ri, int si);
39  EggVertex *calc_sphere2_vertex(int ri, int si);
40  EggVertex *calc_tube_vertex(int ri, int si);
41  void add_polygon(EggVertex *a, EggVertex *b, EggVertex *c, EggVertex *d);
42 
43 private:
44  double _point_a[3];
45  double _point_b[3];
46  bool _got_point_b;
47  double _radius;
48  int _num_slices;
49  int _num_crings;
50  int _num_trings;
51 
52  double _length;
53  EggGroup *_group;
54  EggVertexPool *_vpool;
55 };
56 
57 #endif
58 
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
Definition: eggGroup.h:36
Any one-, two-, three-, or four-component vertex, possibly with attributes such as a normal...
Definition: eggVertex.h:41
A base class for a family of programs that generate egg models of various fundamental shapes...
A program to generate an egg file representing a tube model, similar in shape to a CollisionTube...
Definition: eggMakeTube.h:31
A collection of vertices.
Definition: eggVertexPool.h:46