| 438 | } |
| 439 | |
| 440 | bool 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 | |
| 469 | F64 PathManager::getClosestTimeToPoint(const U32 id, const Point3F p) |
| 470 | { |