MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / readASFData

Method readASFData

physx/samples/samplebase/AcclaimLoader.cpp:558–625  ·  view source on GitHub ↗

//////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

556
557///////////////////////////////////////////////////////////////////////////////
558bool Acclaim::readASFData(const char* filename, Acclaim::ASFData& data)
559{
560 using namespace Acclaim;
561
562 char token[MAX_TOKEN_LENGTH];
563
564 SampleFramework::File* fp = NULL;
565 PxToolkit::fopen_s(&fp, filename, "r");
566
567 if (!fp)
568 return false;
569
570 SampleFileBuffer buffer(fp);
571
572 while (buffer.getNextToken(token, false) == true)
573 {
574 if (token[0] == '#') // comment
575 {
576 buffer.skipUntilNextLine();
577 continue;
578 }
579 else if (token[0] == ':') // blocks
580 {
581 const char* str = token + 1; // remainder of the string
582
583 if (strcmp(str, "version") == 0) // ignore version number
584 buffer.skipUntilNextLine();
585 else if (strcmp(str, "name") == 0) // probably 'VICON'
586 buffer.skipUntilNextLine();
587 else if (strcmp(str, "units") == 0)
588 {
589 if ( readHeader(buffer, data) == false)
590 return false;
591 }
592 else if (strcmp(str, "documentation") == 0)
593 buffer.skipUntilNextBlock();
594 else if (strcmp(str, "root") == 0)
595 {
596 if (readRoot(buffer, data) == false)
597 return false;
598 }
599 else if (strcmp(str, "bonedata") == 0)
600 {
601 if (readBoneData(buffer, data) == false)
602 return false;
603 }
604 else if (strcmp(str, "hierarchy") == 0)
605 {
606 if (readHierarchy(buffer, data) == false)
607 return false;
608 }
609 else
610 {
611 // ERROR! - unrecognized block name
612 }
613 }
614 else
615 {

Callers

nothing calls this directly

Calls 9

strcmpFunction · 0.85
readRootFunction · 0.85
readBoneDataFunction · 0.85
readHierarchyFunction · 0.85
getNextTokenMethod · 0.80
skipUntilNextLineMethod · 0.80
skipUntilNextBlockMethod · 0.80
readHeaderFunction · 0.70
fopen_sFunction · 0.50

Tested by

no test coverage detected