lwoSurfaceBlockProjection.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 lwoSurfaceBlockProjection.h
  10. * @author drose
  11. * @date 2001-04-24
  12. */
  13. #ifndef LWOSURFACEBLOCKPROJECTION_H
  14. #define LWOSURFACEBLOCKPROJECTION_H
  15. #include "pandatoolbase.h"
  16. #include "lwoChunk.h"
  17. /**
  18. * Indicates the projection mode for this particular shader. This determines
  19. * how UV coordinates should be computed based on the vertex positions. This
  20. * is a subchunk of LwoSurfaceBlock.
  21. */
  22. class LwoSurfaceBlockProjection : public LwoChunk {
  23. public:
  24. enum Mode {
  25. M_planar = 0,
  26. M_cylindrical = 1,
  27. M_spherical = 2,
  28. M_cubic = 3,
  29. M_front = 4,
  30. M_uv = 5
  31. };
  32. Mode _mode;
  33. public:
  34. virtual bool read_iff(IffInputFile *in, size_t stop_at);
  35. virtual void write(std::ostream &out, int indent_level = 0) const;
  36. public:
  37. virtual TypeHandle get_type() const {
  38. return get_class_type();
  39. }
  40. virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
  41. static TypeHandle get_class_type() {
  42. return _type_handle;
  43. }
  44. static void init_type() {
  45. LwoChunk::init_type();
  46. register_type(_type_handle, "LwoSurfaceBlockProjection",
  47. LwoChunk::get_class_type());
  48. }
  49. private:
  50. static TypeHandle _type_handle;
  51. };
  52. #endif