Panda3D
|
This is an abstract base class that holds a pointer to some transform, computed in some arbitrary way, that is to be applied to vertices during rendering. More...
#include "vertexTransform.h"
Classes | |
class | CData |
Public Member Functions | |
virtual void | accumulate_matrix (LMatrix4 &accum, PN_stdfloat weight) const |
Adds the value of this transform's matrix, modified by the indicated weight, into the indicated accumulation matrix. | |
virtual TypeHandle | force_init_type () |
virtual void | get_matrix (LMatrix4 &matrix) const =0 |
UpdateSeq | get_modified (Thread *current_thread) const |
Returns a sequence number that's guaranteed to change at least every time the value reported by get_matrix() changes. | |
virtual TypeHandle | get_type () const |
virtual void | mult_matrix (LMatrix4 &result, const LMatrix4 &previous) const |
Premultiplies this transform's matrix with the indicated previous matrix, so that the result is the net composition of the given transform with this transform. | |
virtual void | output (ostream &out) const |
virtual void | write (ostream &out, int indent_level) 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 TypeHandle | get_class_type () |
static UpdateSeq | get_global_modified (Thread *current_thread) |
Returns the currently highest VertexTransform::get_modified() value in the world. | |
static UpdateSeq | get_next_modified (Thread *current_thread) |
Returns a monotonically increasing sequence. | |
static void | init_type () |
Protected Member Functions | |
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 VertexTransform. | |
void | mark_modified (Thread *current_thread) |
Intended to be called by a derived class whenever the reported transform might have changed. | |
Friends | |
class | TransformTable |
This is an abstract base class that holds a pointer to some transform, computed in some arbitrary way, that is to be applied to vertices during rendering.
This is used to implement soft-skinned and animated vertices. Derived classes will define how the transform is actually computed.
Definition at line 39 of file vertexTransform.h.
void VertexTransform::accumulate_matrix | ( | LMatrix4 & | accum, |
PN_stdfloat | weight | ||
) | const [virtual] |
Adds the value of this transform's matrix, modified by the indicated weight, into the indicated accumulation matrix.
This is used to compute the result of several blended transforms.
Reimplemented in JointVertexTransform.
Definition at line 74 of file vertexTransform.cxx.
References LMatrix4f::accumulate().
void VertexTransform::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 VertexTransform.
Reimplemented from TypedWritable.
Reimplemented in UserVertexTransform, and JointVertexTransform.
Definition at line 165 of file vertexTransform.cxx.
UpdateSeq VertexTransform::get_global_modified | ( | Thread * | current_thread | ) | [inline, static] |
Returns the currently highest VertexTransform::get_modified() value in the world.
This can be used as a quick way to determine if any VertexTransforms have changed value recently.
Definition at line 38 of file vertexTransform.I.
Referenced by TransformBlendTable::get_modified(), TransformBlend::get_modified(), and TransformBlend::update_blend().
UpdateSeq VertexTransform::get_modified | ( | Thread * | current_thread | ) | const [inline] |
Returns a sequence number that's guaranteed to change at least every time the value reported by get_matrix() changes.
Definition at line 24 of file vertexTransform.I.
UpdateSeq VertexTransform::get_next_modified | ( | Thread * | current_thread | ) | [static] |
Returns a monotonically increasing sequence.
Each time this is called, a new sequence number is returned, higher than the previous value.
This is used to ensure that all VertexTransform::get_modified() calls return an increasing number in the same space, so that TransformBlend::get_modified() is easy to determine. It is similar to Geom::get_modified(), but it is in a different space.
Definition at line 119 of file vertexTransform.cxx.
Referenced by VertexSlider::mark_modified(), and mark_modified().
void VertexTransform::mark_modified | ( | Thread * | current_thread | ) | [protected] |
Intended to be called by a derived class whenever the reported transform might have changed.
Without calling this method, changes to get_matrix() may not be propagated through the system.
Definition at line 136 of file vertexTransform.cxx.
References ordered_vector< Key, Compare >::begin(), ordered_vector< Key, Compare >::end(), and get_next_modified().
Referenced by JointVertexTransform::fillin(), JointVertexTransform::JointVertexTransform(), and UserVertexTransform::set_matrix().
void VertexTransform::mult_matrix | ( | LMatrix4 & | result, |
const LMatrix4 & | previous | ||
) | const [virtual] |
Premultiplies this transform's matrix with the indicated previous matrix, so that the result is the net composition of the given transform with this transform.
The result is stored in the parameter "result", which should not be the same matrix as previous.
Reimplemented in JointVertexTransform.
Definition at line 58 of file vertexTransform.cxx.
Referenced by DXGraphicsStateGuardian8::begin_draw_primitives(), and DXGraphicsStateGuardian9::begin_draw_primitives().
void VertexTransform::write_datagram | ( | BamWriter * | manager, |
Datagram & | dg | ||
) | [virtual] |
Writes the contents of this object to the datagram for shipping out to a Bam file.
Reimplemented from TypedWritable.
Reimplemented in UserVertexTransform, and JointVertexTransform.
Definition at line 153 of file vertexTransform.cxx.