fltVectorRecord.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 fltVectorRecord.h
  10. * @author drose
  11. * @date 2002-08-30
  12. */
  13. #ifndef FLTVECTORRECORD_H
  14. #define FLTVECTORRECORD_H
  15. #include "pandatoolbase.h"
  16. #include "fltRecord.h"
  17. #include "luse.h"
  18. /**
  19. * This is an ancillary record of the old (pre-15.4) face node. Its only use
  20. * is to provide the direction vector for unidirectional and bidirectional
  21. * light point faces.
  22. */
  23. class FltVectorRecord : public FltRecord {
  24. public:
  25. FltVectorRecord(FltHeader *header);
  26. const LVector3 &get_vector() const;
  27. protected:
  28. LVector3 _vector;
  29. protected:
  30. virtual bool extract_record(FltRecordReader &reader);
  31. virtual bool build_record(FltRecordWriter &writer) const;
  32. public:
  33. virtual TypeHandle get_type() const {
  34. return get_class_type();
  35. }
  36. virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
  37. static TypeHandle get_class_type() {
  38. return _type_handle;
  39. }
  40. static void init_type() {
  41. FltRecord::init_type();
  42. register_type(_type_handle, "FltVectorRecord",
  43. FltRecord::get_class_type());
  44. }
  45. private:
  46. static TypeHandle _type_handle;
  47. friend class FltBead;
  48. };
  49. #endif