00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef CARDMAKER_H
00020 #define CARDMAKER_H
00021
00022 #include "pandabase.h"
00023
00024 #include "luse.h"
00025 #include "pandaNode.h"
00026 #include "pointerTo.h"
00027 #include "namable.h"
00028
00029
00030
00031
00032
00033
00034
00035 class EXPCL_PANDA CardMaker : public Namable {
00036 PUBLISHED:
00037 INLINE CardMaker(const string &name);
00038 INLINE ~CardMaker();
00039
00040 void reset();
00041 INLINE void set_uv_range(const TexCoordf &ll, const TexCoordf &ur);
00042 INLINE void set_has_uvs(bool flag);
00043
00044 INLINE void set_frame(float left, float right, float bottom, float top);
00045 INLINE void set_frame(const LVecBase4f &frame);
00046
00047 INLINE void set_color(float r, float g, float b, float a);
00048 INLINE void set_color(const Colorf &color);
00049
00050 INLINE void set_source_geometry(PandaNode *node, const LVecBase4f &frame);
00051 INLINE void clear_source_geometry();
00052
00053 PT(PandaNode) generate();
00054
00055 private:
00056 PT(PandaNode) rescale_source_geometry();
00057
00058 bool _has_uvs;
00059 TexCoordf _ll, _ur;
00060 LVecBase4f _frame;
00061
00062 bool _has_color;
00063 Colorf _color;
00064
00065 PT(PandaNode) _source_geometry;
00066 LVecBase4f _source_frame;
00067 };
00068
00069 #include "cardMaker.I"
00070
00071 #endif
00072