Panda3D
characterJointEffect.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file characterJointEffect.h
10  * @author drose
11  * @date 2006-07-26
12  */
13 
14 #ifndef CHARACTERJOINTEFFECT_H
15 #define CHARACTERJOINTEFFECT_H
16 
17 #include "pandabase.h"
18 
19 #include "renderEffect.h"
20 #include "luse.h"
21 #include "nodePath.h"
22 #include "character.h"
23 #include "weakPointerTo.h"
24 
25 /**
26  * This effect will be added automatically to a node by
27  * CharacterJoint::add_net_transform() and
28  * CharacterJoint::add_local_transform().
29  *
30  * The effect binds the node back to the character, so that querying the
31  * relative transform of the affected node will automatically force the
32  * indicated character to be updated first.
33  */
34 class EXPCL_PANDA_CHAR CharacterJointEffect : public RenderEffect {
35 private:
36  INLINE CharacterJointEffect();
37 
38 PUBLISHED:
39  static CPT(RenderEffect) make(Character *character);
40 
41  INLINE PT(Character) get_character() const;
42 
43 public:
44  INLINE bool matches_character(Character *character) const;
45 
46  virtual bool safe_to_transform() const;
47  virtual bool safe_to_combine() const;
48  virtual void output(std::ostream &out) const;
49 
50  virtual bool has_cull_callback() const;
51  virtual void cull_callback(CullTraverser *trav, CullTraverserData &data,
52  CPT(TransformState) &node_transform,
53  CPT(RenderState) &node_state) const;
54 
55  virtual bool has_adjust_transform() const;
56  virtual void adjust_transform(CPT(TransformState) &net_transform,
57  CPT(TransformState) &node_transform,
58  const PandaNode *node) const;
59 
60 protected:
61  virtual int compare_to_impl(const RenderEffect *other) const;
62 
63 private:
64  WPT(Character) _character;
65 
66 public:
67  static void register_with_read_factory();
68  virtual void write_datagram(BamWriter *manager, Datagram &dg);
70  BamReader *manager);
71 
72 protected:
73  static TypedWritable *make_from_bam(const FactoryParams &params);
74  void fillin(DatagramIterator &scan, BamReader *manager);
75 
76 public:
77  static TypeHandle get_class_type() {
78  return _type_handle;
79  }
80  static void init_type() {
81  RenderEffect::init_type();
82  register_type(_type_handle, "CharacterJointEffect",
83  RenderEffect::get_class_type());
84  }
85  virtual TypeHandle get_type() const {
86  return get_class_type();
87  }
88  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
89 
90 private:
91  static TypeHandle _type_handle;
92 };
93 
94 #include "characterJointEffect.I"
95 
96 #endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:110
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition: bamWriter.h:63
This effect will be added automatically to a node by CharacterJoint::add_net_transform() and Characte...
An animated character, with skeleton-morph animation and either soft- skinned or hard-skinned vertice...
Definition: character.h:38
This collects together the pieces of data that are accumulated for each node while walking the scene ...
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling,...
Definition: cullTraverser.h:45
A class to retrieve the individual data elements previously stored in a Datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:38
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:36
A basic node of the scene graph or data graph.
Definition: pandaNode.h:65
This is the base class for a number of special render effects that may be set on scene graph nodes to...
Definition: renderEffect.h:48
virtual bool safe_to_transform() const
Returns true if it is generally safe to transform this particular kind of RenderEffect by calling the...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
Definition: renderState.h:47
Indicates a coordinate-system transform on vertices.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:35
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().
This is our own Panda specialization on the default STL list.
Definition: plist.h:35
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(),...
Definition: register_type.I:22
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.