15 #include "characterJointEffect.h"
16 #include "cullTraverser.h"
17 #include "cullTraverserData.h"
20 #include "bamReader.h"
21 #include "bamWriter.h"
23 #include "datagramIterator.h"
39 effect->_character = character;
43 DCAST_INTO_R(new_effect, new_effect_raw, new_effect_raw);
61 if (!new_effect->_character.is_valid_pointer()) {
62 nassertr(new_effect->_character.get_orig() == character, new_effect_raw);
66 return new_effect_raw;
101 void CharacterJointEffect::
102 output(ostream &out)
const {
104 if (_character.is_valid_pointer()) {
105 out <<
"(" << _character->get_name() <<
")";
107 out <<
"(**invalid**)";
144 CPT(TransformState) &node_transform,
146 CPT(TransformState) dummy_transform = TransformState::make_identity();
176 CPT(TransformState) &node_transform,
178 if (_character.is_valid_pointer()) {
179 _character->update();
181 node_transform = node->get_transform();
200 int CharacterJointEffect::
203 DCAST_INTO_R(ta, other, 0);
205 if (_character.get_orig() != ta->_character.get_orig()) {
206 return _character.get_orig() < ta->_character.get_orig() ? -1 : 1;
239 if (_character.is_valid_pointer()) {
257 _character = DCAST(
Character, p_list[pi++]);
276 parse_params(params, scan, manager);
277 effect->fillin(scan, manager);
289 void CharacterJointEffect::
291 RenderEffect::fillin(scan, manager);
A basic node of the scene graph or data graph.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
An animated character, with skeleton-morph animation and either soft-skinned or hard-skinned vertices...
This effect will be added automatically to a node by CharacterJoint::add_net_transform() and Characte...
Base class for objects that can be written to and read from Bam files.
This collects together the pieces of data that are accumulated for each node while walking the scene ...
PandaNode * node() const
Returns the node traversed to so far.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
This is the base class for a number of special render effects that may be set on scene graph nodes to...
virtual int complete_pointers(TypedWritable **plist, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin()...
virtual void adjust_transform(CPT(TransformState)&net_transform, CPT(TransformState)&node_transform, PandaNode *node) const
Performs some operation on the node's apparent net and/or local transforms.
virtual bool safe_to_transform() const
Returns true if it is generally safe to transform this particular kind of RenderEffect by calling the...
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()...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
virtual bool has_cull_callback() const
Should be overridden by derived classes to return true if cull_callback() has been defined...
virtual void cull_callback(CullTraverser *trav, CullTraverserData &data, CPT(TransformState)&node_transform, CPT(RenderState)&node_state) const
If has_cull_callback() returns true, this function will be called during the cull traversal to perfor...
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
void register_factory(TypeHandle handle, CreateFunc *func)
Registers a new kind of thing the Factory will be able to create.
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 WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
virtual bool has_adjust_transform() const
Should be overridden by derived classes to return true if adjust_transform() has been defined...
A class to retrieve the individual data elements previously stored in a Datagram. ...
static void register_with_read_factory()
Tells the BamReader how to create objects of type CharacterJointEffect.
TypeHandle is the identifier used to differentiate C++ class types.
virtual bool safe_to_combine() const
Returns true if this kind of effect can safely be combined with sibling nodes that share the exact sa...
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling...
void write_pointer(Datagram &packet, const TypedWritable *dest)
The interface for writing a pointer to another object to a Bam file.
void read_pointer(DatagramIterator &scan)
The interface for reading a pointer to another object from a Bam file.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.