32 if (_joint !=
nullptr && _joint->is_joint()) {
35 if (!_joint->has_transform()) {
36 _joint->set_transform3d(LMatrix4d::ident_mat());
63 nassertr(n == 0, LMatrix4d::ident_mat());
64 return _joint->get_transform3d();
78 _joint->set_transform3d(mat);
87 if (new_parent ==
nullptr) {
90 if (egg_parent !=
nullptr) {
91 egg_parent->remove_child(_joint.p());
99 if (new_node->_joint != _joint->get_parent()) {
100 new_node->_joint->add_child(_joint.p());
111 if (new_joint ==
nullptr) {
112 _joint->unref_all_vertices();
116 DCAST_INTO_V(new_node, new_joint);
118 new_node->_joint->steal_vrefs(_joint);
135 if (!db.
get_matrix(
this, EggCharacterDb::TT_rebuild_frame, 0, mat)) {
140 _joint->set_transform3d(mat);
143 nassertr(!db.
get_matrix(
this, EggCharacterDb::TT_rebuild_frame, 1, mat),
false);
154 if (_joint !=
nullptr) {
155 _joint->set_dcs_type(dcs_type);
165 if (_joint !=
nullptr) {
168 pose = source_joint->get_frame(frame);
172 _joint->clear_default_pose();
173 _joint->modify_default_pose().add_matrix4(pose);
184 if (_joint !=
nullptr) {
185 return (_joint->vref_size() != 0) || _joint->joint_has_primitives();
198 new_joint->set_group_type(EggGroup::GT_joint);
199 _joint->add_child(new_joint);
208 _joint->set_name(name);
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void set_name(const std::string &name)
Applies the indicated name change to the egg file.
virtual LMatrix4d get_frame(int n) const
Returns the transform matrix corresponding to this joint position in the nth frame.
A base class for nodes in the hierarchy that are not leaf nodes.
virtual EggJointPointer * make_new_joint(const std::string &name)
Creates a new child of the current joint in the egg data, and returns a pointer to it.
virtual void apply_default_pose(EggJointPointer *source_joint, int frame)
Applies the pose from the indicated frame of the indicated source joint as the initial pose for this ...
virtual void move_vertices_to(EggJointPointer *new_joint)
Moves the vertices assigned to this joint into the other joint (which should be of the same type).
virtual bool has_vertices() const
Returns true if there are any vertices referenced by the node this points to, false otherwise.
virtual bool do_rebuild(EggCharacterDb &db)
Rebuilds the entire table all at once, based on the frames added by repeated calls to add_rebuild_fra...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void do_finish_reparent(EggJointPointer *new_parent)
Performs the actual reparenting operation by removing the node from its old parent and associating it...
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
This stores a pointer back to a <Joint> node.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class is used during joint optimization or restructuring to store the table of interim joint com...
virtual int get_num_frames() const
Returns the number of frames of animation for this particular joint.
void steal_children(EggGroupNode &other)
Moves all the children from the other node to this one.
virtual void expose(EggGroup::DCSType dcs_type)
Flags the joint with the indicated DCS flag so that it will be loaded as a separate node in the playe...
This is a base class for EggJointNodePointer and EggMatrixTablePointer.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
The highest-level base class in the egg directory.
bool get_matrix(const EggJointPointer *joint, TableType type, int frame, LMatrix4d &mat) const
Looks up the data for the indicated joint, type, and frame, and fills it in result (and returns true)...
virtual void set_frame(int n, const LMatrix4d &mat)
Sets the transform matrix corresponding to this joint position in the nth frame.