Assets/Deps/emotitron/Network/NST/NSTFrameBuffer.cs
/// <summary>
/// Copy one frame to another. Used when the buffer is empty and either need to copy the current frame or resort to the offtick frame.
/// </summary>
Copy one frame to another. Used when the buffer is empty and either need to copy the current frame or resort to the offtick frame.
Copy one frame to another . Used when the buffer is empty and either need to copy the current frame or resort to the offtick frame .
public void CopyFrame(Frame sourceFrame, Frame targetFrame, bool includePositions = true, bool includeRotations = true)
		{
			targetFrame.pos = sourceFrame.pos;
			targetFrame.compPos = sourceFrame.compPos;
			targetFrame.endTime = sourceFrame.endTime;
			targetFrame.appliedTime = sourceFrame.appliedTime;
			targetFrame.msgType = (sourceFrame.msgType == MsgType.Cust_Msg) ? MsgType.Position : sourceFrame.msgType;
			if (includePositions)
			{
				targetFrame.positionsMask = sourceFrame.positionsMask;
				for (int i = 0; i < targetFrame.positions.Count; i++)
				{
					GenericX.Copy(sourceFrame.positions[i], targetFrame.positions[i]);
					DebugX.Log(Time.time + " " + i + " Copy Source Pos " + sourceFrame.positions[i]);
				}
			}
			if (includeRotations)
			{
				targetFrame.rotationsMask = sourceFrame.rotationsMask;
				for (int i = 0; i < targetFrame.rotations.Count; i++)
				{
					GenericX.Copy(sourceFrame.rotations[i], targetFrame.rotations[i]);
					DebugX.Log(Time.time + " " + i + " Copy Source Rot " + sourceFrame.rotations[i]);
				}
			}
			targetFrame.packetArriveTime = Time.time;
		}
public void CopyFrame ( Frame sourceFrame , Frame targetFrame , bool includePositions = true , bool includeRotations = true ) { targetFrame . pos = sourceFrame . pos ; targetFrame . compPos = sourceFrame . compPos ; targetFrame . endTime = sourceFrame . endTime ; targetFrame . appliedTime = sourceFrame . appliedTime ; targetFrame . msgType = ( sourceFrame . msgType == MsgType . Cust_Msg ) ? MsgType . Position : sourceFrame . msgType ; if ( includePositions ) { targetFrame . positionsMask = sourceFrame . positionsMask ; for ( int i = 0 ; i < targetFrame . positions . Count ; i ++ ) { GenericX . Copy ( sourceFrame . positions [ i ] , targetFrame . positions [ i ] ) ; DebugX . Log ( Time . time + " " + i + " " + sourceFrame . positions [ i ] ) ; } } if ( includeRotations ) { targetFrame . rotationsMask = sourceFrame . rotationsMask ; for ( int i = 0 ; i < targetFrame . rotations . Count ; i ++ ) { GenericX . Copy ( sourceFrame . rotations [ i ] , targetFrame . rotations [ i ] ) ; DebugX . Log ( Time . time + " " + i + " " + sourceFrame . rotations [ i ] ) ; } } targetFrame . packetArriveTime = Time . time ; }
Copy one frame to another.
Copy one frame to another .
// Strip the custom message flag from copies, or they will fire twice.
sourceFrame
Frame
targetFrame
Frame
includePositions
bool
includeRotations
bool