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

Method unpackUpdate

Engine/source/T3D/fx/fxShapeReplicator.cpp:716–759  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

714//------------------------------------------------------------------------------
715
716void fxShapeReplicator::unpackUpdate(NetConnection * con, BitStream * stream)
717{
718 // Unpack Parent.
719 Parent::unpackUpdate(con, stream);
720
721 // Read Replication Details.
722 if(stream->readFlag())
723 {
724 MatrixF ReplicatorObjectMatrix;
725
726 stream->readAffineTransform(&ReplicatorObjectMatrix); // Replication Position.
727
728 mFieldData.mSeed = stream->readInt(32); // Replicator Seed.
729 mFieldData.mShapeCount = stream->readInt(32); // Shapes Count.
730 mFieldData.mShapeRetries = stream->readInt(32); // Shapes Retries.
731 mFieldData.mShapeFile = stream->readSTString(); // Shape File.
732 mFieldData.mInnerRadiusX = stream->readInt(32); // Shapes Inner Radius X.
733 mFieldData.mInnerRadiusY = stream->readInt(32); // Shapes Inner Radius Y.
734 mFieldData.mOuterRadiusX = stream->readInt(32); // Shapes Outer Radius X.
735 mFieldData.mOuterRadiusY = stream->readInt(32); // Shapes Outer Radius Y.
736 mathRead(*stream, &mFieldData.mShapeScaleMin); // Shapes Scale Min.
737 mathRead(*stream, &mFieldData.mShapeScaleMax); // Shapes Scale Max.
738 mathRead(*stream, &mFieldData.mShapeRotateMin); // Shapes Rotate Min.
739 mathRead(*stream, &mFieldData.mShapeRotateMax); // Shapes Rotate Max.
740 mFieldData.mOffsetZ = stream->readSignedInt(32); // Shapes Offset Z.
741 mFieldData.mAllowOnTerrain = stream->readFlag(); // Allow on Terrain.
742 mFieldData.mAllowStatics = stream->readFlag(); // Allow on Statics.
743 mFieldData.mAllowOnWater = stream->readFlag(); // Allow on Water.
744 mFieldData.mAllowWaterSurface = stream->readFlag(); // Allow on Water Surface.
745 mFieldData.mAllowedTerrainSlope = stream->readSignedInt(32); // Allowed Terrain Slope.
746 mFieldData.mAlignToTerrain = stream->readFlag(); // Read AlignToTerrain.
747 mathRead(*stream, &mFieldData.mTerrainAlignment); // Read Terrain Alignment.
748 mFieldData.mHideReplications = stream->readFlag(); // Hide Replications.
749 mFieldData.mInteractions = stream->readFlag(); // Read Interactions.
750 mFieldData.mShowPlacementArea = stream->readFlag(); // Show Placement Area Flag.
751 mFieldData.mPlacementBandHeight = stream->readInt(32); // Placement Area Height.
752 stream->read(&mFieldData.mPlaceAreaColour);
753
754 // Set Transform.
755 setTransform(ReplicatorObjectMatrix);
756
757 RenewShapes();
758 }
759}
760

Callers

nothing calls this directly

Calls 7

mathReadFunction · 0.85
readFlagMethod · 0.80
readAffineTransformMethod · 0.80
readIntMethod · 0.80
readSignedIntMethod · 0.80
readSTStringMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected