35 effect->_character = character;
39 DCAST_INTO_R(new_effect, new_effect_raw, new_effect_raw);
56 if (!new_effect->_character.is_valid_pointer()) {
57 nassertr(new_effect->_character.get_orig() == character, new_effect_raw);
61 return new_effect_raw;
89 void CharacterJointEffect::
90 output(std::ostream &out)
const {
92 PT(
Character) character = get_character();
93 if (character !=
nullptr) {
94 out <<
"(" << character->get_name() <<
")";
96 out <<
"(**invalid**)";
126 if (
auto character = _character.lock()) {
129 node_transform = data.node()->get_transform();
154 if (
auto character = _character.lock()) {
157 node_transform = node->get_transform();
173 int CharacterJointEffect::
176 DCAST_INTO_R(ta, other, 0);
178 if (_character.get_orig() != ta->_character.get_orig()) {
179 return _character.get_orig() < ta->_character.get_orig() ? -1 : 1;
206 PT(
Character) character = get_character();
218 _character = DCAST(
Character, p_list[pi++]);
235 effect->fillin(scan, manager);
244 void CharacterJointEffect::
246 RenderEffect::fillin(scan, manager);
A basic node of the scene graph or data graph.
CPT(RenderEffect) CharacterJointEffect
Constructs a new CharacterJointEffect object that references the indicated character.
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 vertice...
virtual bool has_adjust_transform() const
Should be overridden by derived classes to return true if adjust_transform() has been defined,...
This effect will be added automatically to a node by CharacterJoint::add_net_transform() and Characte...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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 ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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().
void parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...
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...
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().
virtual bool safe_to_transform() const
Returns true if it is generally safe to transform this particular kind of RenderEffect by calling the...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_factory(TypeHandle handle, CreateFunc *func, void *user_data=nullptr)
Registers a new kind of thing the Factory will be able to create.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool read_pointer(DatagramIterator &scan)
The interface for reading a pointer to another object from a Bam file.
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...
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 void adjust_transform(CPT(TransformState) &net_transform, CPT(TransformState) &node_transform, const PandaNode *node) const
Performs some operation on the node's apparent net and/or local transforms.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
virtual bool has_cull_callback() const
Should be overridden by derived classes to return true if cull_callback() has been defined.
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void write_pointer(Datagram &packet, const TypedWritable *dest)
The interface for writing a pointer to another object to 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.