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

Function readFrameData

physx/samples/samplebase/AcclaimLoader.cpp:512–555  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

510
511///////////////////////////////////////////////////////////////////////////////
512static bool readFrameData(SampleFileBuffer& buffer, Acclaim::ASFData& asfData, Acclaim::FrameData& frameData)
513{
514 using namespace Acclaim;
515 char token[MAX_TOKEN_LENGTH];
516
517 while (buffer.getNextTokenButNumeric(token) == true)
518 {
519 if (strcmp(token, "root") == 0)
520 {
521 buffer.getNextVec3(frameData.mRootPosition);
522 buffer.getNextVec3(frameData.mRootOrientation);
523 }
524 else
525 {
526 Bone* bone = getBoneFromName(asfData, token);
527
528 if (bone == 0)
529 return false;
530
531 int id = bone->mID - 1;
532 float val = 0;
533 if (bone->mDOF & BoneDOFFlag::eRX)
534 {
535
536 buffer.getNextFloat(val);
537 frameData.mBoneFrameData[id].x = val;
538 }
539 if (bone->mDOF & BoneDOFFlag::eRY)
540 {
541
542 buffer.getNextFloat(val);
543 frameData.mBoneFrameData[id].y = val;
544 }
545 if (bone->mDOF & BoneDOFFlag::eRZ)
546 {
547
548 buffer.getNextFloat(val);
549 frameData.mBoneFrameData[id].z = val;
550 }
551 }
552 }
553
554 return true;
555}
556
557///////////////////////////////////////////////////////////////////////////////
558bool Acclaim::readASFData(const char* filename, Acclaim::ASFData& data)

Callers 1

readAMCDataMethod · 0.85

Calls 5

strcmpFunction · 0.85
getNextVec3Method · 0.80
getNextFloatMethod · 0.80
getBoneFromNameFunction · 0.70

Tested by

no test coverage detected