00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef FLTVERTEX_H
00016 #define FLTVERTEX_H
00017
00018 #include "pandatoolbase.h"
00019
00020 #include "fltRecord.h"
00021 #include "fltPackedColor.h"
00022
00023 #include "luse.h"
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 class FltVertex : public FltRecord {
00036 public:
00037 FltVertex(FltHeader *header);
00038
00039 FltOpcode get_opcode() const;
00040 int get_record_length() const;
00041
00042 enum Flags {
00043 F_hard_edge = 0x8000,
00044 F_normal_frozen = 0x4000,
00045 F_no_color = 0x2000,
00046 F_packed_color = 0x1000
00047 };
00048
00049 int _color_name_index;
00050 unsigned int _flags;
00051 LPoint3d _pos;
00052 LPoint3 _normal;
00053 LPoint2 _uv;
00054 FltPackedColor _packed_color;
00055 int _color_index;
00056
00057 bool _has_normal;
00058 bool _has_uv;
00059
00060 public:
00061 INLINE bool has_color() const;
00062 LColor get_color() const;
00063 INLINE void set_color(const LColor &color);
00064 LRGBColor get_rgb() const;
00065 void set_rgb(const LRGBColor &rgb);
00066
00067
00068 protected:
00069 virtual bool extract_record(FltRecordReader &reader);
00070 virtual bool build_record(FltRecordWriter &writer) const;
00071
00072 public:
00073 virtual TypeHandle get_type() const {
00074 return get_class_type();
00075 }
00076 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00077 static TypeHandle get_class_type() {
00078 return _type_handle;
00079 }
00080 static void init_type() {
00081 FltRecord::init_type();
00082 register_type(_type_handle, "FltVertex",
00083 FltRecord::get_class_type());
00084 }
00085
00086 private:
00087 static TypeHandle _type_handle;
00088
00089 friend class FltHeader;
00090 };
00091
00092 #include "fltVertex.I"
00093
00094 #endif
00095
00096