00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef EGGVERTEXUV_H
00016 #define EGGVERTEXUV_H
00017
00018 #include "pandabase.h"
00019
00020 #include "eggMorphList.h"
00021 #include "eggNamedObject.h"
00022
00023 #include "luse.h"
00024
00025
00026
00027
00028
00029
00030
00031
00032 class EXPCL_PANDAEGG EggVertexUV : public EggNamedObject {
00033 PUBLISHED:
00034 EggVertexUV(const string &name, const LTexCoordd &uv);
00035 EggVertexUV(const string &name, const LTexCoord3d &uvw);
00036 EggVertexUV(const EggVertexUV ©);
00037 EggVertexUV &operator = (const EggVertexUV ©);
00038 virtual ~EggVertexUV();
00039
00040 INLINE static string filter_name(const string &name);
00041 INLINE void set_name(const string &name);
00042
00043 INLINE int get_num_dimensions() const;
00044 INLINE bool has_w() const;
00045 INLINE LTexCoordd get_uv() const;
00046 INLINE const LTexCoord3d &get_uvw() const;
00047 INLINE void set_uv(const LTexCoordd &texCoord);
00048 INLINE void set_uvw(const LTexCoord3d &texCoord);
00049
00050 INLINE bool has_tangent() const;
00051 INLINE const LNormald &get_tangent() const;
00052 INLINE void set_tangent(const LNormald &tangent);
00053 INLINE void clear_tangent();
00054
00055 INLINE bool has_binormal() const;
00056 INLINE const LNormald &get_binormal() const;
00057 INLINE void set_binormal(const LNormald &binormal);
00058 INLINE void clear_binormal();
00059
00060 void transform(const LMatrix4d &mat);
00061
00062 void write(ostream &out, int indent_level) const;
00063 int compare_to(const EggVertexUV &other) const;
00064
00065 EggMorphTexCoordList _duvs;
00066
00067 private:
00068 enum Flags {
00069 F_has_tangent = 0x001,
00070 F_has_binormal = 0x002,
00071 F_has_w = 0x004,
00072 };
00073
00074 int _flags;
00075 LNormald _tangent;
00076 LNormald _binormal;
00077 LTexCoord3d _uvw;
00078
00079 public:
00080 static TypeHandle get_class_type() {
00081 return _type_handle;
00082 }
00083 static void init_type() {
00084 EggNamedObject::init_type();
00085 register_type(_type_handle, "EggVertexUV",
00086 EggNamedObject::get_class_type());
00087 }
00088 virtual TypeHandle get_type() const {
00089 return get_class_type();
00090 }
00091 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00092
00093 private:
00094 static TypeHandle _type_handle;
00095 };
00096
00097 #include "eggVertexUV.I"
00098
00099 #endif
00100