コード例 #1
0
        static MyCharacterNetState ReadCharacterState(BitStream stream, out Vector3 move)
        {
            MyCharacterNetState charNetState = new MyCharacterNetState();

            charNetState.WorldRealSpeed = stream.ReadHalf();
            // Head and spine stuff
            charNetState.HeadX = stream.ReadHalf();
            if (charNetState.HeadX.IsValid() == false)
            {
                charNetState.HeadX = 0.0f;
            }
            charNetState.HeadY = stream.ReadHalf();
            charNetState.Spine = stream.ReadQuaternionNormCompressedIdentity();
            charNetState.Head = stream.ReadQuaternionNormCompressedIdentity();
            // Movement state
            charNetState.MovementState = (MyCharacterMovementEnum)stream.ReadUInt16();
            // Movement flag
            charNetState.MovementFlag = (MyCharacterMovementFlags)stream.ReadUInt16();
            //Flags
            charNetState.Jetpack = stream.ReadBool();
            charNetState.Dampeners = stream.ReadBool();
            charNetState.Lights = stream.ReadBool(); // TODO: Remove
            charNetState.Ironsight = stream.ReadBool();
            charNetState.Broadcast = stream.ReadBool(); // TODO: Remove
            charNetState.TargetFromCamera = stream.ReadBool();

            move = stream.ReadNormalizedSignedVector3(8);

            return charNetState;
        }