| 401 | } |
| 402 | |
| 403 | void PathShape::unpackUpdate(NetConnection *con, BitStream *stream) |
| 404 | { |
| 405 | Parent::unpackUpdate(con,stream); |
| 406 | |
| 407 | // StateMask |
| 408 | if (stream->readFlag()) |
| 409 | mState = stream->readInt(StateBits); |
| 410 | |
| 411 | // PositionMask |
| 412 | if (stream->readFlag()) { |
| 413 | stream->read(&mPosition); |
| 414 | delta.time = mPosition; |
| 415 | delta.timeVec = 0; |
| 416 | } |
| 417 | |
| 418 | // TargetMask |
| 419 | if (stream->readFlag()) { |
| 420 | mTargetSet = stream->readFlag(); |
| 421 | if (mTargetSet) { |
| 422 | stream->read(&mTarget); |
| 423 | } |
| 424 | } |
| 425 | |
| 426 | // WindowMask |
| 427 | if (stream->readFlag()) { |
| 428 | mSpline.removeAll(); |
| 429 | stream->read(&mNodeBase); |
| 430 | stream->read(&mNodeCount); |
| 431 | for (S32 i = 0; i < mNodeCount; i++) { |
| 432 | CameraSpline::Knot *knot = new CameraSpline::Knot(); |
| 433 | mathRead(*stream, &knot->mPosition); |
| 434 | mathRead(*stream, &knot->mRotation); |
| 435 | stream->read(&knot->mSpeed); |
| 436 | knot->mType = (CameraSpline::Knot::Type)stream->readInt(CameraSpline::Knot::NUM_TYPE_BITS); |
| 437 | knot->mPath = (CameraSpline::Knot::Path)stream->readInt(CameraSpline::Knot::NUM_PATH_BITS); |
| 438 | mSpline.push_back(knot); |
| 439 | } |
| 440 | } |
| 441 | |
| 442 | // Controlled by the client? |
| 443 | if (stream->readFlag()) return; |
| 444 | } |
| 445 | |
| 446 | |
| 447 | //----------------------------------------------------------------------------- |