MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / unpackUpdate

Method unpackUpdate

Engine/source/T3D/camera.cpp:1234–1303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1232//----------------------------------------------------------------------------
1233
1234void Camera::unpackUpdate(NetConnection *con, BitStream *bstream)
1235{
1236 Parent::unpackUpdate(con,bstream);
1237
1238 if (bstream->readFlag())
1239 {
1240 mLocked = bstream->readFlag();
1241 mathRead(*bstream, &mOffset);
1242 }
1243
1244 // NewtonCameraMask
1245 if(bstream->readFlag())
1246 {
1247 bstream->read(&mAngularForce);
1248 bstream->read(&mAngularDrag);
1249 bstream->read(&mMass);
1250 bstream->read(&mDrag);
1251 bstream->read(&mFlyForce);
1252 bstream->read(&mSpeedMultiplier);
1253 bstream->read(&mBrakeMultiplier);
1254 }
1255
1256 // EditOrbitMask
1257 if(bstream->readFlag())
1258 {
1259 bstream->read(&mEditOrbitPoint.x);
1260 bstream->read(&mEditOrbitPoint.y);
1261 bstream->read(&mEditOrbitPoint.z);
1262 bstream->read(&mCurrentEditOrbitDist);
1263 }
1264
1265 // controlled by the client?
1266 if(bstream->readFlag())
1267 return;
1268
1269 // MoveMask
1270 if (bstream->readFlag())
1271 {
1272 Point3F pos,rot;
1273 bstream->read(&pos.x);
1274 bstream->read(&pos.y);
1275 bstream->read(&pos.z);
1276 bstream->read(&rot.x);
1277 bstream->read(&rot.z);
1278 _setPosition(pos,rot);
1279
1280 // NewtonMode
1281 if(bstream->readFlag())
1282 {
1283 bstream->readNormalVector(&mVelocity, 10);
1284 mVelocity *= bstream->readInt(13) / 32.0f;
1285 }
1286
1287 // NewtonRotation
1288 mNewtonRotation = bstream->readFlag();
1289 if(mNewtonRotation)
1290 {
1291 bstream->readNormalVector(&mAngularVelocity, 10);

Callers

nothing calls this directly

Calls 5

mathReadFunction · 0.85
readFlagMethod · 0.80
readNormalVectorMethod · 0.80
readIntMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected