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

Method readState

Engine/source/scene/pathManager.cpp:440–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

438}
439
440bool PathManager::readState(BitStream* stream)
441{
442 U32 i;
443 for (i = 0; i < mPaths.size(); i++)
444 delete mPaths[i];
445
446 U32 numPaths;
447 stream->read(&numPaths);
448 mPaths.setSize(numPaths);
449
450 for (i = 0; i < mPaths.size(); i++) {
451 mPaths[i] = new PathEntry;
452 PathEntry& rEntry = *mPaths[i];
453
454 stream->read(&rEntry.totalTime);
455
456 U32 numPositions;
457 stream->read(&numPositions);
458 rEntry.positions.setSize(numPositions);
459 rEntry.msToNext.setSize(numPositions);
460 for (U32 j = 0; j < rEntry.positions.size(); j++) {
461 mathRead(*stream, &rEntry.positions[j]);
462 stream->read(&rEntry.msToNext[j]);
463 }
464 }
465
466 return stream->getStatus() == Stream::Ok;
467}
468
469F64 PathManager::getClosestTimeToPoint(const U32 id, const Point3F p)
470{

Callers 1

readDemoStartBlockMethod · 0.80

Calls 5

mathReadFunction · 0.85
sizeMethod · 0.45
readMethod · 0.45
setSizeMethod · 0.45
getStatusMethod · 0.45

Tested by

no test coverage detected