46class EXPCL_PANDA_CHAN PartBundle :
public PartGroup {
51 typedef pmap<AnimControl *, PN_stdfloat> ChannelBlend;
55 PartBundle(
const PartBundle ©);
58 explicit PartBundle(
const std::string &name =
"");
95 BT_componentwise_quat,
108 INLINE
void xform(
const LMatrix4 &mat);
113 INLINE PartBundleNode *
get_node(
int n)
const;
126 virtual void output(std::ostream &out)
const;
127 virtual void write(std::ostream &out,
int indent_level)
const;
130 int hierarchy_match_flags = 0,
134 int hierarchy_match_flags,
140 bool freeze_joint(
const std::string &joint_name,
const LVecBase3 &pos,
const LVecBase3 &hpr,
const LVecBase3 &scale);
141 bool freeze_joint(
const std::string &joint_name, PN_stdfloat value);
156 int hierarchy_match_flags,
const PartSubset &subset);
159 virtual void add_node(PartBundleNode *node);
160 virtual void remove_node(PartBundleNode *node);
165 void do_set_control_effect(
AnimControl *control, PN_stdfloat effect, CData *cdata);
166 PN_stdfloat do_get_control_effect(
AnimControl *control,
const CData *cdata)
const;
167 void recompute_net_blend(CData *cdata);
168 void clear_and_stop_intersecting(
AnimControl *control, CData *cdata);
172 typedef pvector<PartBundleNode *> Nodes;
176 AppliedTransforms _applied_transforms;
178 double _update_delay;
184 CData(
const CData ©);
190 return PartBundle::get_class_type();
193 BlendType _blend_type;
194 bool _anim_blend_flag;
195 bool _frame_blend_flag;
196 LMatrix4 _root_xform;
199 PN_stdfloat _net_blend;
204 PipelineCycler<CData> _cycler;
205 typedef CycleDataLockedReader<CData> CDLockedReader;
206 typedef CycleDataReader<CData> CDReader;
207 typedef CycleDataWriter<CData> CDWriter;
208 typedef CycleDataStageWriter<CData> CDStageWriter;
212 virtual void finalize(BamReader *manager);
218 static TypedWritable *make_from_bam(
const FactoryParams ¶ms);
219 void fillin(DatagramIterator &scan, BamReader *manager);
223 virtual TypeHandle get_type()
const {
224 return get_class_type();
226 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
227 static TypeHandle get_class_type() {
230 static void init_type() {
231 PartGroup::init_type();
233 PartGroup::get_class_type());
237 static TypeHandle _type_handle;
239 friend class PartBundleNode;
240 friend class Character;
241 friend class MovingPartBase;
242 friend class MovingPartMatrix;
243 friend class MovingPartScalar;
246inline std::ostream &operator <<(std::ostream &out,
const PartBundle &bundle) {
251EXPCL_PANDA_CHAN std::ostream &operator <<(std::ostream &out, PartBundle::BlendType blend_type);
252EXPCL_PANDA_CHAN std::istream &operator >>(std::istream &in, PartBundle::BlendType &blend_type);
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the root of an AnimChannel hierarchy.
Controls the timing of a character animation.
This table records data about a list of animations for a particular model, such as number of frames a...
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
A single page of data maintained by a PipelineCycler.
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 ...
The name of a file, such as a texture file or an Egg file.
A convenient class for loading models from disk, in bam or egg format (or any of a number of other fo...
void output(std::ostream &out) const
Outputs the Namable.
A basic node of the scene graph or data graph.
This is a node that contains a pointer to an PartBundle.
This is the root of a MovingPart hierarchy.
set_anim_blend_flag
Defines the way the character responds to multiple calls to set_control_effect()).
virtual void output(std::ostream &out) const
Writes a one-line description of the bundle.
virtual void control_activated(AnimControl *control)
Called by the AnimControl whenever it starts an animation.
get_node
Returns the nth PartBundleNode associated with this PartBundle.
void set_update_delay(double delay)
Specifies the minimum amount of time, in seconds, that should elapse between any two consecutive upda...
bool update()
Updates all the parts in the bundle to reflect the data for the current frame (as set in each of the ...
bool release_joint(const std::string &joint_name)
Releases the named joint from the effects of a previous call to freeze_joint() or control_joint().
get_frame_blend_flag
Returns whether the character interpolates (blends) between two sequential animation frames,...
void set_anim_preload(AnimPreloadTable *table)
Replaces the AnimPreloadTable associated with the PartBundle.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
void wait_pending()
Blocks the current thread until all currently-pending AnimControls, with a nonzero control effect,...
get_blend_type
Returns the algorithm that is used when blending multiple frames or multiple animations together,...
bool control_joint(const std::string &joint_name, PandaNode *node)
Specifies that the joint with the indicated name should be animated with the transform on the indicat...
PN_stdfloat get_control_effect(AnimControl *control) const
Returns the amount by which the character is affected by the indicated AnimControl and its associated...
void xform(const LMatrix4 &mat)
Applies the indicated transform to the root of the animated hierarchy.
get_root_xform
Returns the transform matrix which is implicitly applied at the root of the animated hierarchy.
void clear_control_effects()
Sets the control effect of all AnimControls to zero (but does not "stop" the AnimControls).
void merge_anim_preloads(const PartBundle *other)
Copies the contents of the other PartBundle's preload table into this one.
set_frame_blend_flag
Specifies whether the character interpolates (blends) between two sequential frames of an active anim...
void set_control_effect(AnimControl *control, PN_stdfloat effect)
Sets the amount by which the character is affected by the indicated AnimControl (and its associated a...
void control_removed(AnimControl *control)
Called by the AnimControl when it destructs.
void clear_anim_preload()
Removes any AnimPreloadTable associated with the PartBundle.
set_root_xform
Specifies the transform matrix which is implicitly applied at the root of the animated hierarchy.
get_num_nodes
Returns the number of PartBundleNodes that contain a pointer to this PartBundle.
bool force_update()
Updates all the parts in the bundle to reflect the data for the current frame, whether we believe it ...
get_anim_blend_flag
Returns whether the character allows multiple different animations to be bound simultaneously.
bool freeze_joint(const std::string &joint_name, const TransformState *transform)
Specifies that the joint with the indicated name should be frozen with the specified transform.
bool do_bind_anim(AnimControl *control, AnimBundle *anim, int hierarchy_match_flags, const PartSubset &subset)
The internal implementation of bind_anim(), this receives a pointer to an uninitialized AnimControl a...
set_blend_type
Defines the algorithm that is used when blending multiple frames or multiple animations together,...
virtual PartGroup * make_copy() const
Allocates and returns a new copy of the node.
virtual void write(std::ostream &out, int indent_level) const
Writes a brief description of the group and all of its descendants.
virtual PartGroup * make_copy() const
Allocates and returns a new copy of the node.
virtual void write_datagram(BamWriter *manager, Datagram &me)
Function to write the important information in the particular object to a Datagram.
static void register_with_read_factory()
Factory method to generate a PartGroup object.
virtual int complete_pointers(TypedWritable **p_list, BamReader *manager)
Takes in a vector of pointers to TypedWritable objects that correspond to all the requests for pointe...
This class is used to define a subset of part names to apply to the PartBundle::bind_anim() operation...
TypeHandle is the identifier used to differentiate C++ class types.
virtual void finalize(BamReader *manager)
Called by the BamReader to perform any final actions needed for setting up the object after all objec...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.