eggMakeTube.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /**
  2. * PANDA 3D SOFTWARE
  3. * Copyright (c) Carnegie Mellon University. All rights reserved.
  4. *
  5. * All use of this software is subject to the terms of the revised BSD
  6. * license. You should have received a copy of this license along
  7. * with this source code in a file named "LICENSE."
  8. *
  9. * @file eggMakeTube.h
  10. * @author drose
  11. * @date 2003-10-01
  12. */
  13. #ifndef EGGMAKETUBE_H
  14. #define EGGMAKETUBE_H
  15. #include "pandatoolbase.h"
  16. #include "eggMakeSomething.h"
  17. class EggGroup;
  18. class EggVertexPool;
  19. class EggVertex;
  20. /**
  21. * A program to generate an egg file representing a tube model, similar in
  22. * shape to a CollisionCapsule.
  23. */
  24. class EggMakeTube : public EggMakeSomething {
  25. public:
  26. EggMakeTube();
  27. void run();
  28. private:
  29. EggVertex *calc_sphere1_vertex(int ri, int si);
  30. EggVertex *calc_sphere2_vertex(int ri, int si);
  31. EggVertex *calc_tube_vertex(int ri, int si);
  32. void add_polygon(EggVertex *a, EggVertex *b, EggVertex *c, EggVertex *d);
  33. private:
  34. double _point_a[3];
  35. double _point_b[3];
  36. bool _got_point_b;
  37. double _radius;
  38. int _num_slices;
  39. int _num_crings;
  40. int _num_trings;
  41. double _length;
  42. EggGroup *_group;
  43. EggVertexPool *_vpool;
  44. };
  45. #endif