| 1064 | //---------------------------------------------------------------------------- |
| 1065 | |
| 1066 | void Camera::readPacketData(GameConnection *connection, BitStream *bstream) |
| 1067 | { |
| 1068 | Parent::readPacketData(connection, bstream); |
| 1069 | Point3F pos,rot; |
| 1070 | mathRead(*bstream, &pos); |
| 1071 | bstream->setCompressionPoint(pos); |
| 1072 | bstream->read(&rot.x); |
| 1073 | if(bstream->readFlag()) |
| 1074 | { |
| 1075 | // Include rot.y to allow for camera banking |
| 1076 | bstream->read(&rot.y); |
| 1077 | } |
| 1078 | bstream->read(&rot.z); |
| 1079 | |
| 1080 | GameBase* obj = 0; |
| 1081 | mMode = (CameraMotionMode)bstream->readRangedU32(CameraFirstMode, CameraLastMode); |
| 1082 | mObservingClientObject = false; |
| 1083 | if (mMode == OrbitObjectMode || mMode == OrbitPointMode) |
| 1084 | { |
| 1085 | bstream->read(&mMinOrbitDist); |
| 1086 | bstream->read(&mMaxOrbitDist); |
| 1087 | bstream->read(&mCurOrbitDist); |
| 1088 | |
| 1089 | if(mMode == OrbitObjectMode) |
| 1090 | { |
| 1091 | mObservingClientObject = bstream->readFlag(); |
| 1092 | S32 gIndex = bstream->readInt(NetConnection::GhostIdBitSize); |
| 1093 | obj = static_cast<GameBase*>(connection->resolveGhost(gIndex)); |
| 1094 | } |
| 1095 | if (mMode == OrbitPointMode) |
| 1096 | bstream->readCompressedPoint(&mPosition); |
| 1097 | } |
| 1098 | else if (mMode == TrackObjectMode) |
| 1099 | { |
| 1100 | S32 gIndex = bstream->readInt(NetConnection::GhostIdBitSize); |
| 1101 | obj = static_cast<GameBase*>(connection->resolveGhost(gIndex)); |
| 1102 | } |
| 1103 | |
| 1104 | if (obj != (GameBase*)mOrbitObject) |
| 1105 | { |
| 1106 | if (mOrbitObject) |
| 1107 | { |
| 1108 | clearProcessAfter(); |
| 1109 | clearNotify(mOrbitObject); |
| 1110 | } |
| 1111 | |
| 1112 | mOrbitObject = obj; |
| 1113 | if (mOrbitObject) |
| 1114 | { |
| 1115 | processAfter(mOrbitObject); |
| 1116 | deleteNotify(mOrbitObject); |
| 1117 | } |
| 1118 | } |
| 1119 | |
| 1120 | mNewtonMode = bstream->readFlag(); |
| 1121 | if(mNewtonMode) |
| 1122 | { |
| 1123 | bstream->read(&mVelocity.x); |
nothing calls this directly
no test coverage detected