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

Method getDomCOLLADA

Engine/source/ts/collada/colladaShapeLoader.cpp:584–614  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Get the root collada DOM element for the given DAE file

Source from the content-addressed store, hash-verified

582//-----------------------------------------------------------------------------
583/// Get the root collada DOM element for the given DAE file
584domCOLLADA* ColladaShapeLoader::getDomCOLLADA(const Torque::Path& path)
585{
586 daeErrorHandler::setErrorHandler(&sErrorHandler);
587
588 TSShapeLoader::updateProgress(TSShapeLoader::Load_ReadFile, path.getFullFileName().c_str());
589
590 // Check if we can use the last loaded file
591 FileTime daeModifyTime;
592 if (Platform::getFileTimes(path.getFullPath(), NULL, &daeModifyTime))
593 {
594 if ((path == sLastPath) && (Platform::compareFileTimes(sLastModTime, daeModifyTime) >= 0))
595 return sDAE.getRoot(path.getFullPath().c_str());
596 }
597
598 sDAE.clear();
599 sDAE.setBaseURI("");
600
601 TSShapeLoader::updateProgress(TSShapeLoader::Load_ParseFile, "Parsing XML...");
602 domCOLLADA* root = readColladaFile(path.getFullPath());
603 if (!root)
604 {
605 TSShapeLoader::updateProgress(TSShapeLoader::Load_Complete, "Import failed");
606 sDAE.clear();
607 return NULL;
608 }
609
610 sLastPath = path;
611 sLastModTime = daeModifyTime;
612
613 return root;
614}
615
616domCOLLADA* ColladaShapeLoader::readColladaFile(const String& path)
617{

Callers

nothing calls this directly

Calls 4

setBaseURIMethod · 0.80
c_strMethod · 0.45
getRootMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected