mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
Support for tags
This commit is contained in:
parent
4ec660096d
commit
8a72714793
@ -250,6 +250,7 @@ void DAEToEggConverter::process_node(PT(EggGroupNode) parent, const FCDSceneNode
|
||||
}
|
||||
// Create an egg group for this node
|
||||
PT(EggGroup) node_group = new EggGroup(node_id);
|
||||
process_extra(node_group, node->GetExtra());
|
||||
parent->add_child(node_group);
|
||||
// Check if its a joint
|
||||
if (node->IsJoint()) {
|
||||
@ -617,6 +618,32 @@ void DAEToEggConverter::process_controller(PT(EggGroup) parent, const FCDControl
|
||||
_table->add_child(character->as_egg_bundle());
|
||||
}
|
||||
|
||||
void DAEToEggConverter::process_extra(PT(EggGroup) group, const FCDExtra* extra) {
|
||||
if (extra == NULL) {
|
||||
return;
|
||||
}
|
||||
nassertv(group != NULL);
|
||||
|
||||
const FCDEType* etype = extra->GetDefaultType();
|
||||
if (etype == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
const FCDENode* enode = (const FCDENode*) etype->FindTechnique("PANDA3D");
|
||||
if (enode == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
FCDENodeList tags;
|
||||
enode->FindChildrenNodes("param", tags);
|
||||
for (FCDENodeList::iterator it = tags.begin(); it != tags.end(); ++it) {
|
||||
const FCDEAttribute* attr = (*it)->FindAttribute("sid");
|
||||
if (attr) {
|
||||
group->set_tag(FROM_FSTRING(attr->GetValue()), (*it)->GetContent());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LMatrix4d DAEToEggConverter::convert_matrix(const FMMatrix44& matrix) {
|
||||
LMatrix4d result = LMatrix4d::zeros_mat();
|
||||
for (char x = 0; x < 4; ++x) {
|
||||
|
@ -74,6 +74,7 @@ private:
|
||||
void process_spline(PT(EggGroup) parent, const FCDSpline* spline);
|
||||
void process_controller(PT(EggGroup) parent, const FCDControllerInstance* instance);
|
||||
//void process_table_joint(PT(EggTable) parent, FCDSceneNode* node);
|
||||
void process_extra(PT(EggGroup) group, const FCDExtra* extra);
|
||||
|
||||
static LMatrix4d convert_matrix(const FMMatrix44& matrix);
|
||||
void apply_transform(const PT(EggGroup) to, const FCDTransform* from);
|
||||
|
Loading…
x
Reference in New Issue
Block a user