mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
just a little cleanup: deleted some codes that aren't necessary
This commit is contained in:
parent
d1b2691371
commit
d8e19f716a
@ -454,13 +454,6 @@ get_transform(SAA_Scene *scene, EggGroup *egg_group, bool global) {
|
|||||||
// Get the model's matrix
|
// Get the model's matrix
|
||||||
int scale_joint = 0;
|
int scale_joint = 0;
|
||||||
|
|
||||||
/*
|
|
||||||
if ( _parentJoint && strstr( _parentJoint->get_name().c_str(), "scale" ) != NULL ) {
|
|
||||||
scale_joint = 1;
|
|
||||||
softegg_cat.spam() << "scale joint flag set!\n";
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (!global && _parentJoint && !stec.flatten && !scale_joint) {
|
if (!global && _parentJoint && !stec.flatten && !scale_joint) {
|
||||||
|
|
||||||
SAA_modelGetMatrix( scene, get_model(), SAA_COORDSYS_LOCAL, matrix );
|
SAA_modelGetMatrix( scene, get_model(), SAA_COORDSYS_LOCAL, matrix );
|
||||||
@ -521,13 +514,6 @@ get_joint_transform(SAA_Scene *scene, EggGroup *egg_group, EggXfmSAnim *anim, b
|
|||||||
float x,y,z;
|
float x,y,z;
|
||||||
int scale_joint = 0;
|
int scale_joint = 0;
|
||||||
|
|
||||||
/*
|
|
||||||
if ( _parentJoint && strstr( _parentJoint->get_name().c_str(), "scale" ) != NULL ) {
|
|
||||||
scale_joint = 1;
|
|
||||||
softegg_cat.spam() << "scale joint flag set!\n";
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
softegg_cat.spam() << "\n\nanimating child " << name << endl;
|
softegg_cat.spam() << "\n\nanimating child " << name << endl;
|
||||||
|
|
||||||
if (_parentJoint && !stec.flatten && !scale_joint ) {
|
if (_parentJoint && !stec.flatten && !scale_joint ) {
|
||||||
|
@ -223,13 +223,6 @@ build_complete_hierarchy(SAA_Scene &scene, SAA_Database &database) {
|
|||||||
// find _parentJoint for each node
|
// find _parentJoint for each node
|
||||||
_root->set_parentJoint(&scene, NULL);
|
_root->set_parentJoint(&scene, NULL);
|
||||||
|
|
||||||
/*
|
|
||||||
if (stec.flatten) {
|
|
||||||
softegg_cat.spam() << "rprprprprprprprprprprprprprprprprprprprprprprprprprprprpr\n";
|
|
||||||
reparent_flatten(_root);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
return all_ok;
|
return all_ok;
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
@ -600,25 +593,13 @@ r_build_node(SoftNodeDesc *parent_node, const string &name) {
|
|||||||
if (ni != _nodes_by_name.end()) {
|
if (ni != _nodes_by_name.end()) {
|
||||||
softegg_cat.spam() << " already built node " << (*ni).first;
|
softegg_cat.spam() << " already built node " << (*ni).first;
|
||||||
node_desc = (*ni).second;
|
node_desc = (*ni).second;
|
||||||
|
node_desc->set_parent(parent_node);
|
||||||
/*
|
|
||||||
if (stec.flatten)
|
|
||||||
node_desc->set_parent(_root);
|
|
||||||
else
|
|
||||||
*/
|
|
||||||
node_desc->set_parent(parent_node);
|
|
||||||
|
|
||||||
return node_desc;
|
return node_desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, we have to create it. Do this recursively, so we
|
// Otherwise, we have to create it. Do this recursively, so we
|
||||||
// create each node along the path.
|
// create each node along the path.
|
||||||
/*
|
node_desc = new SoftNodeDesc(parent_node, name);
|
||||||
if (stec.flatten)
|
|
||||||
node_desc = new SoftNodeDesc(_root, name);
|
|
||||||
else
|
|
||||||
*/
|
|
||||||
node_desc = new SoftNodeDesc(parent_node, name);
|
|
||||||
|
|
||||||
softegg_cat.spam() << " node name : " << name << endl;
|
softegg_cat.spam() << " node name : " << name << endl;
|
||||||
_nodes.push_back(node_desc);
|
_nodes.push_back(node_desc);
|
||||||
@ -628,30 +609,6 @@ r_build_node(SoftNodeDesc *parent_node, const string &name) {
|
|||||||
return node_desc;
|
return node_desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
// Function: SoftNodeTree::reparent_flatten
|
|
||||||
// Access: Private
|
|
||||||
// Description: recursively, reparent all nodes to root
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
void SoftNodeTree::
|
|
||||||
reparent_flatten(SoftNodeDesc *node) {
|
|
||||||
// get a copy of the current childrens
|
|
||||||
SoftNodeDesc::Children old_children = node->_children;
|
|
||||||
// clear the _children to make room for new ones
|
|
||||||
node->_children.clear();
|
|
||||||
|
|
||||||
if (node != _root) {
|
|
||||||
softegg_cat.spam() << "reparenting " << node << ":" << node->get_name();
|
|
||||||
node->force_set_parent(_root);
|
|
||||||
}
|
|
||||||
|
|
||||||
SoftNodeDesc::Children::const_iterator ci;
|
|
||||||
for (ci = old_children.begin(); ci != old_children.end(); ++ci) {
|
|
||||||
SoftNodeDesc *child = (*ci);
|
|
||||||
reparent_flatten(child);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
@ -73,7 +73,6 @@ private:
|
|||||||
EggGroupNode *_skeleton_node;
|
EggGroupNode *_skeleton_node;
|
||||||
|
|
||||||
SoftNodeDesc *r_build_node(SoftNodeDesc *parent_node, const string &path);
|
SoftNodeDesc *r_build_node(SoftNodeDesc *parent_node, const string &path);
|
||||||
void reparent_flatten(SoftNodeDesc *node);
|
|
||||||
|
|
||||||
typedef pmap<string, SoftNodeDesc *> NodesByName;
|
typedef pmap<string, SoftNodeDesc *> NodesByName;
|
||||||
NodesByName _nodes_by_name;
|
NodesByName _nodes_by_name;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user