MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / ColladaAppNode

Method ColladaAppNode

Engine/source/ts/collada/colladaAppNode.cpp:59–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59ColladaAppNode::ColladaAppNode(const domNode* node, ColladaAppNode* parent)
60 : p_domNode(node), appParent(parent),
61 nodeExt(new ColladaExtension_node(node)),
62 invertMeshes(false),
63 lastTransformTime(TSShapeLoader::DefaultTime-1),
64 defaultTransformValid(false)
65
66{
67 mName = dStrdup(_GetNameOrId(node));
68 mParentName = dStrdup(parent ? parent->getName() : "ROOT");
69
70 // Extract user properties from the <node> extension as whitespace separated
71 // "name=value" pairs
72 char* properties = dStrdup(nodeExt->user_properties);
73 char* pos = properties;
74 char* end = properties + dStrlen( properties );
75 while ( pos < end )
76 {
77 // Find the '=' character to separate the name and value pair
78 char* split = dStrchr( pos, '=' );
79 if ( !split )
80 break;
81
82 // Get the name (whitespace trimmed string up to the '=')
83 // and value (whitespace trimmed string after the '=')
84 *split = '\0';
85 char* name = TrimFirstWord( pos );
86 char* value = TrimFirstWord( split + 1 );
87
88 mProps.insert(StringTable->insert(name), dAtof(value));
89
90 pos = value + dStrlen( value ) + 1;
91 }
92
93 dFree( properties );
94
95 // Create vector of transform elements
96 for (S32 iChild = 0; iChild < node->getContents().getCount(); iChild++) {
97 switch (node->getContents()[iChild]->getElementType()) {
98 case COLLADA_TYPE::TRANSLATE:
99 case COLLADA_TYPE::ROTATE:
100 case COLLADA_TYPE::SCALE:
101 case COLLADA_TYPE::SKEW:
102 case COLLADA_TYPE::MATRIX:
103 case COLLADA_TYPE::LOOKAT:
104 nodeTransforms.increment();
105 nodeTransforms.last().element = node->getContents()[iChild];
106 break;
107 }
108 }
109}
110
111// Get all child nodes
112void ColladaAppNode::buildChildList()

Callers

nothing calls this directly

Calls 13

_GetNameOrIdFunction · 0.85
TrimFirstWordFunction · 0.85
dAtofFunction · 0.85
getContentsMethod · 0.80
incrementMethod · 0.80
dStrlenFunction · 0.50
dStrchrFunction · 0.50
dFreeFunction · 0.50
getNameMethod · 0.45
insertMethod · 0.45
getCountMethod · 0.45
getElementTypeMethod · 0.45

Tested by

no test coverage detected