14#ifndef TEXMATRIXATTRIB_H
15#define TEXMATRIXATTRIB_H
30class EXPCL_PANDA_PGRAPH TexMatrixAttrib :
public RenderAttrib {
32 INLINE TexMatrixAttrib();
33 INLINE TexMatrixAttrib(
const TexMatrixAttrib ©);
36 virtual ~TexMatrixAttrib();
39 static CPT(RenderAttrib)
make();
40 static CPT(RenderAttrib)
make(
const LMatrix4 &mat);
54 const LMatrix4 &
get_mat()
const;
63 virtual void output(std::ostream &out)
const;
66 virtual int compare_to_impl(
const RenderAttrib *other)
const;
67 virtual size_t get_hash_impl()
const;
68 virtual CPT(RenderAttrib) compose_impl(
const RenderAttrib *other)
const;
69 virtual CPT(RenderAttrib) invert_compose_impl(
const RenderAttrib *other)
const;
72 INLINE
void check_stage_list()
const;
73 void rebuild_stage_list();
80 INLINE
bool operator < (
const StageNode &other)
const;
87 class CompareTextureStagePointer {
89 INLINE
bool operator () (
const TexMatrixAttrib::StageNode &a,
const TexMatrixAttrib::StageNode &b)
const;
92 typedef ov_set<StageNode, CompareTextureStagePointer> Stages;
95 static CPT(RenderAttrib) _empty_attrib;
98 static int get_class_slot() {
101 virtual int get_slot()
const {
102 return get_class_slot();
104 MAKE_PROPERTY(class_slot, get_class_slot);
107 static void register_with_read_factory();
112 static TypedWritable *make_from_bam(
const FactoryParams ¶ms);
113 void fillin(DatagramIterator &scan, BamReader *manager);
116 static TypeHandle get_class_type() {
119 static void init_type() {
120 RenderAttrib::init_type();
122 RenderAttrib::get_class_type());
123 _attrib_slot =
register_slot(_type_handle, 100,
new TexMatrixAttrib);
125 virtual TypeHandle get_type()
const {
126 return get_class_type();
128 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
131 static TypeHandle _type_handle;
132 static int _attrib_slot;
An instance of this class is passed to the Factory when requesting it to do its business and construc...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
static int register_slot(TypeHandle type_handle, int sort, RenderAttrib *default_attrib)
Adds the indicated TypeHandle to the registry, if it is not there already, and returns a unique slot ...
bool is_empty() const
Returns true if no stages are defined in the TexMatrixAttrib, false if at least one is.
ConstPointerTo< TransformState > get_transform(TextureStage *stage) const
Returns the transformation associated with the indicated texture stage, or identity matrix if nothing...
static ConstPointerTo< RenderAttrib > make()
Constructs a TexMatrixAttrib that applies no stages at all.
const LMatrix4 & get_mat() const
Returns the transformation matrix associated with the default texture stage.
ConstPointerTo< RenderAttrib > add_stage(TextureStage *stage, const TransformState *transform, int override=0) const
Returns a new TexMatrixAttrib just like this one, with the indicated transform for the given stage.
ConstPointerTo< RenderAttrib > remove_stage(TextureStage *stage) const
Returns a new TexMatrixAttrib just like this one, with the indicated stage removed.
bool has_stage(TextureStage *stage) const
Returns true if there is a transform associated with the indicated stage, or false otherwise (in whic...
get_num_stages
Returns the number of stages that are represented by this attrib.
int get_override(TextureStage *stage) const
Returns the override value associated with the indicated stage.
static ConstPointerTo< RenderAttrib > make_default()
Returns a RenderAttrib that corresponds to whatever the standard default properties for render attrib...
int get_geom_rendering(int geom_rendering) const
Returns the union of the Geom::GeomRendering bits that will be required once this TexMatrixAttrib is ...
get_stage
Returns the nth stage that is represented by this attrib.
Defines the properties of a named stage of the multitexture pipeline.
virtual int complete_pointers(TypedWritable **p_list, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.