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

Method unpackUpdate

Engine/source/T3D/camera.cpp:1235–1305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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