Panda3D
|
Applies a transform matrix to UV's before they are rendered. More...
#include "texMatrixAttrib.h"
Classes | |
class | CompareTextureStagePointer |
class | StageNode |
Public Member Functions | |
virtual int | complete_pointers (TypedWritable **plist, BamReader *manager) |
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin(). | |
CPT (RenderAttrib) add_stage(TextureStage *stage | |
CPT (TransformState) get_transform(TextureStage *stage) const | |
CPT (RenderAttrib) remove_stage(TextureStage *stage) const | |
virtual TypeHandle | force_init_type () |
int | get_geom_rendering (int geom_rendering) const |
Returns the union of the Geom::GeomRendering bits that will be required once this TexMatrixAttrib is applied to a geom which includes the indicated geom_rendering bits. | |
const LMatrix4f & | get_mat () const |
Returns the transformation matrix associated with the default texture stage. | |
const LMatrix4f & | get_mat (TextureStage *stage) const |
Returns the transformation matrix associated with the indicated texture stage, or identity matrix if nothing is associated with the indicated stage. | |
int | get_num_stages () const |
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. | |
virtual int | get_slot () const |
TextureStage * | get_stage (int n) const |
Returns the nth stage that is represented by this attrib. | |
virtual TypeHandle | get_type () const |
bool | has_stage (TextureStage *stage) const |
Returns true if there is a transform associated with the indicated stage, or false otherwise (in which case get_transform(stage) will return the identity transform). | |
bool | is_empty () const |
Returns true if no stages are defined in the TexMatrixAttrib, false if at least one is. | |
MAKE_SEQ (get_stages, get_num_stages, get_stage) | |
virtual void | output (ostream &out) const |
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 Public Member Functions | |
static | CPT (RenderAttrib) make() |
static | CPT (RenderAttrib) make(const LMatrix4f &mat) |
static | CPT (RenderAttrib) make_default() |
static | CPT (RenderAttrib) make(TextureStage *stage |
static int | get_class_slot () |
static TypeHandle | get_class_type () |
static void | init_type () |
static void | register_with_read_factory () |
Tells the BamReader how to create objects of type TexMatrixAttrib. | |
Public Attributes | |
const TransformState int | override = 0) const |
static const TransformState * | transform |
const TransformState * | transform |
Protected Member Functions | |
TexMatrixAttrib () | |
Use TexMatrixAttrib::make() to construct a new TexMatrixAttrib object. | |
TexMatrixAttrib (const TexMatrixAttrib ©) | |
Use TexMatrixAttrib::make() to construct a new TexMatrixAttrib object. | |
virtual int | compare_to_impl (const RenderAttrib *other) const |
Intended to be overridden by derived TexMatrixAttrib types to return a unique number indicating whether this TexMatrixAttrib is equivalent to the other one. | |
virtual | CPT (RenderAttrib) compose_impl(const RenderAttrib *other) const |
virtual | CPT (RenderAttrib) invert_compose_impl(const RenderAttrib *other) const |
void | fillin (DatagramIterator &scan, BamReader *manager) |
This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new TexMatrixAttrib. | |
Static Protected Member Functions | |
static TypedWritable * | make_from_bam (const FactoryParams ¶ms) |
This function is called by the BamReader's factory when a new object of type TexMatrixAttrib is encountered in the Bam file. |
Applies a transform matrix to UV's before they are rendered.
Definition at line 33 of file texMatrixAttrib.h.
TexMatrixAttrib::TexMatrixAttrib | ( | ) | [inline, protected] |
Use TexMatrixAttrib::make() to construct a new TexMatrixAttrib object.
Definition at line 23 of file texMatrixAttrib.I.
Referenced by make_from_bam().
TexMatrixAttrib::TexMatrixAttrib | ( | const TexMatrixAttrib & | copy | ) | [inline, protected] |
Use TexMatrixAttrib::make() to construct a new TexMatrixAttrib object.
Definition at line 33 of file texMatrixAttrib.I.
int TexMatrixAttrib::compare_to_impl | ( | const RenderAttrib * | other | ) | const [protected, virtual] |
Intended to be overridden by derived TexMatrixAttrib types to return a unique number indicating whether this TexMatrixAttrib is equivalent to the other one.
This should return 0 if the two TexMatrixAttrib objects are equivalent, a number less than zero if this one should be sorted before the other one, and a number greater than zero otherwise.
This will only be called with two TexMatrixAttrib objects whose get_type() functions return the same.
Reimplemented from RenderAttrib.
Definition at line 249 of file texMatrixAttrib.cxx.
References ordered_vector< Key, Compare >::begin(), and ordered_vector< Key, Compare >::end().
int TexMatrixAttrib::complete_pointers | ( | TypedWritable ** | p_list, |
BamReader * | manager | ||
) | [virtual] |
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
Returns the number of pointers processed.
Reimplemented from TypedWritable.
Definition at line 491 of file texMatrixAttrib.cxx.
References get_stage(), ordered_vector< Key, Compare >::size(), and ov_set< Key, Compare >::sort().
void TexMatrixAttrib::fillin | ( | DatagramIterator & | scan, |
BamReader * | manager | ||
) | [protected, virtual] |
This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new TexMatrixAttrib.
Reimplemented from RenderAttrib.
Definition at line 538 of file texMatrixAttrib.cxx.
References BamReader::get_file_minor_ver(), DatagramIterator::get_int32(), DatagramIterator::get_uint16(), ordered_vector< Key, Compare >::push_back(), and BamReader::read_pointer().
Referenced by make_from_bam().
int TexMatrixAttrib::get_geom_rendering | ( | int | geom_rendering | ) | const [inline] |
Returns the union of the Geom::GeomRendering bits that will be required once this TexMatrixAttrib is applied to a geom which includes the indicated geom_rendering bits.
Definition at line 64 of file texMatrixAttrib.I.
References is_empty().
Referenced by RenderState::get_geom_rendering().
const LMatrix4f & TexMatrixAttrib::get_mat | ( | TextureStage * | stage | ) | const |
Returns the transformation matrix associated with the indicated texture stage, or identity matrix if nothing is associated with the indicated stage.
Definition at line 194 of file texMatrixAttrib.cxx.
const LMatrix4f & TexMatrixAttrib::get_mat | ( | ) | const |
Returns the transformation matrix associated with the default texture stage.
Definition at line 133 of file texMatrixAttrib.cxx.
References TextureStage::get_default().
Referenced by GeomNode::apply_attribs_to_vertices(), GeomTransformer::apply_texture_colors(), and GraphicsStateGuardian::fetch_specified_part().
int TexMatrixAttrib::get_num_stages | ( | ) | const |
Returns the number of stages that are represented by this attrib.
Definition at line 169 of file texMatrixAttrib.cxx.
References ordered_vector< Key, Compare >::size().
Referenced by GeomNode::apply_attribs_to_vertices().
int TexMatrixAttrib::get_override | ( | TextureStage * | stage | ) | const [inline] |
Returns the override value associated with the indicated stage.
Definition at line 45 of file texMatrixAttrib.I.
References ordered_vector< Key, Compare >::end().
TextureStage * TexMatrixAttrib::get_stage | ( | int | n | ) | const |
Returns the nth stage that is represented by this attrib.
The TextureStages are in no particular order.
Definition at line 181 of file texMatrixAttrib.cxx.
References ordered_vector< Key, Compare >::size().
Referenced by GeomNode::apply_attribs_to_vertices(), and complete_pointers().
bool TexMatrixAttrib::has_stage | ( | TextureStage * | stage | ) | const |
Returns true if there is a transform associated with the indicated stage, or false otherwise (in which case get_transform(stage) will return the identity transform).
Definition at line 157 of file texMatrixAttrib.cxx.
References ordered_vector< Key, Compare >::end().
Referenced by GeomTransformer::apply_texture_colors(), and NodePath::has_tex_transform().
bool TexMatrixAttrib::is_empty | ( | ) | const |
Returns true if no stages are defined in the TexMatrixAttrib, false if at least one is.
Definition at line 144 of file texMatrixAttrib.cxx.
References ordered_vector< Key, Compare >::empty().
Referenced by get_geom_rendering().
TypedWritable * TexMatrixAttrib::make_from_bam | ( | const FactoryParams & | params | ) | [static, protected] |
This function is called by the BamReader's factory when a new object of type TexMatrixAttrib is encountered in the Bam file.
It should create the TexMatrixAttrib and extract its information from the file.
Definition at line 519 of file texMatrixAttrib.cxx.
References fillin(), and TexMatrixAttrib().
Referenced by register_with_read_factory().
void TexMatrixAttrib::register_with_read_factory | ( | ) | [static] |
Tells the BamReader how to create objects of type TexMatrixAttrib.
Definition at line 457 of file texMatrixAttrib.cxx.
References BamReader::get_factory(), make_from_bam(), and Factory< Type >::register_factory().
Writes the contents of this object to the datagram for shipping out to a Bam file.
Reimplemented from RenderAttrib.
Definition at line 468 of file texMatrixAttrib.cxx.
References Datagram::add_int32(), Datagram::add_uint16(), ordered_vector< Key, Compare >::begin(), ordered_vector< Key, Compare >::end(), ordered_vector< Key, Compare >::size(), and BamWriter::write_pointer().