当前位置: 首页>>代码示例>>C#>>正文


C# ReceiveDataReader.ReadVec3方法代码示例

本文整理汇总了C#中ReceiveDataReader.ReadVec3方法的典型用法代码示例。如果您正苦于以下问题:C# ReceiveDataReader.ReadVec3方法的具体用法?C# ReceiveDataReader.ReadVec3怎么用?C# ReceiveDataReader.ReadVec3使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ReceiveDataReader的用法示例。


在下文中一共展示了ReceiveDataReader.ReadVec3方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Client_ReceivePositions

        void Client_ReceivePositions( RemoteEntityWorld sender, ReceiveDataReader reader )
        {
            //clear snanshots cache if entity is not created
            if( !IsPostCreated )
                client_receivePositionsSnapshots.Clear();

            //check for invalid snapshot cache
            if( client_receivePositionsSnapshots.Count != 0 )
            {
                Client_ReceivePositionsSnapshot lastSnapshot = client_receivePositionsSnapshots[
                    client_receivePositionsSnapshots.Count - 1 ];
                if( lastSnapshot.bodies != null )
                {
                    //remove snapshot cache
                    client_receivePositionsSnapshots.Clear();
                }
            }

            Client_ReceivePositionsSnapshot snapshot = new Client_ReceivePositionsSnapshot();
            snapshot.networkTickNumber = EntitySystemWorld.Instance.NetworkTickCounter;

            //read position
            if( reader.ReadBoolean() )
            {
                snapshot.position = reader.ReadVec3();
            }
            else
            {
                //get position from previous snapshot
                if( client_receivePositionsSnapshots.Count != 0 )
                {
                    snapshot.position = client_receivePositionsSnapshots[
                        client_receivePositionsSnapshots.Count - 1 ].position;
                }
            }

            //read rotation
            if( reader.ReadBoolean() )
            {
                snapshot.rotation = reader.ReadQuat( 16 );
            }
            else
            {
                //get rotation from previous snapshot
                if( client_receivePositionsSnapshots.Count != 0 )
                {
                    snapshot.rotation = client_receivePositionsSnapshots[
                        client_receivePositionsSnapshots.Count - 1 ].rotation;
                }
            }

            //read scale
            if( reader.ReadBoolean() )
            {
                snapshot.scale = reader.ReadVec3();
            }
            else
            {
                //get position from previous snapshot
                if( client_receivePositionsSnapshots.Count != 0 )
                {
                    snapshot.scale = client_receivePositionsSnapshots[
                        client_receivePositionsSnapshots.Count - 1 ].scale;
                }
            }

            if( !reader.Complete() )
                return;

            client_receivePositionsSnapshots.Add( snapshot );

            Client_UpdatePositionsBySnapshots( false );
        }
开发者ID:DarrenHassan,项目名称:GDM4242-GroupD,代码行数:73,代码来源:Dynamic.cs

示例2: Client_ReceivePosition

 void Client_ReceivePosition( RemoteEntityWorld sender, ReceiveDataReader reader )
 {
     Vec3 value = reader.ReadVec3();
     if( !reader.Complete() )
         return;
     Position = value;
 }
开发者ID:whztt07,项目名称:SDK,代码行数:7,代码来源:JigsawPuzzlePiece.cs

示例3: Client_ReceiveBodiesPositions

        void Client_ReceiveBodiesPositions( RemoteEntityWorld sender, ReceiveDataReader reader )
        {
            //clear snapshots cache if entity is not created
            if( !IsPostCreated )
                client_receivePositionsSnapshots.Clear();

            //check for invalid snapshot cache
            if( client_receivePositionsSnapshots.Count != 0 )
            {
                Client_ReceivePositionsSnapshot lastSnapshot = client_receivePositionsSnapshots[
                    client_receivePositionsSnapshots.Count - 1 ];
                if( lastSnapshot.bodies == null )
                {
                    //remove snapshot cache
                    client_receivePositionsSnapshots.Clear();
                }
            }

            int count = (int)reader.ReadVariableUInt32();

            Client_ReceivePositionsSnapshot snapshot = new Client_ReceivePositionsSnapshot();
            snapshot.networkTickNumber = EntitySystemWorld.Instance.NetworkTickCounter;

            snapshot.bodies = new Client_ReceivePositionsSnapshot.BodyItem[ count ];

            //receive bodies positions and rotations
            for( int n = 0; n < count; n++ )
            {
                Client_ReceivePositionsSnapshot.BodyItem bodyItem = new
                    Client_ReceivePositionsSnapshot.BodyItem();

                //read position
                if( reader.ReadBoolean() )
                {
                    bodyItem.position = reader.ReadVec3();
                }
                else
                {
                    //get position from previous snapshot
                    if( client_receivePositionsSnapshots.Count != 0 )
                    {
                        bodyItem.position = client_receivePositionsSnapshots[
                            client_receivePositionsSnapshots.Count - 1 ].bodies[ n ].position;
                    }
                }

                //read rotation
                if( reader.ReadBoolean() )
                {
                    bodyItem.rotation = reader.ReadQuat( 16 );
                }
                else
                {
                    //get rotation from previous snapshot
                    if( client_receivePositionsSnapshots.Count != 0 )
                    {
                        bodyItem.rotation = client_receivePositionsSnapshots[
                            client_receivePositionsSnapshots.Count - 1 ].bodies[ n ].rotation;
                    }
                }

                snapshot.bodies[ n ] = bodyItem;
            }

            if( !reader.Complete() )
                return;

            client_receivePositionsSnapshots.Add( snapshot );

            if( IsPostCreated )
                Client_UpdatePositionsBySnapshots( false );
        }
开发者ID:DarrenHassan,项目名称:GDM4242-GroupD,代码行数:72,代码来源:Dynamic.cs

示例4: Client_ReceiveWeaponVerticalAngle

 private void Client_ReceiveWeaponVerticalAngle(RemoteEntityWorld sender, ReceiveDataReader reader)
 {
     Vec3 value = reader.ReadVec3();
     if (!reader.Complete())
         return;
     groundRelativeVelocity = value;
 }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:7,代码来源:AKCharacter.cs

示例5: Client_ReceiveGroundRelativeVelocity

		void Client_ReceiveGroundRelativeVelocity( RemoteEntityWorld sender, ReceiveDataReader reader )
		{
			Vec3 value = reader.ReadVec3();
			if( !reader.Complete() )
				return;
			groundRelativeVelocity = value;
		}
开发者ID:whztt07,项目名称:NeoAxisCommunity,代码行数:7,代码来源:Character.cs

示例6: Client_ReceiveTurnToPosition

 void Client_ReceiveTurnToPosition( RemoteEntityWorld sender, ReceiveDataReader reader )
 {
     Vec3 turnToPosition = reader.ReadVec3();
     if( !reader.Complete() )
         return;
     SetMomentaryTurnToPosition( turnToPosition );
 }
开发者ID:DarrenHassan,项目名称:GDM4242-GroupD,代码行数:7,代码来源:Turret.cs

示例7: Client_ReceivePropertiesToClient

 void Client_ReceivePropertiesToClient( RemoteEntityWorld sender, ReceiveDataReader reader )
 {
     Size = reader.ReadVec2();
     Position = reader.ReadVec3();
     Segments = reader.ReadVec2i();
     RenderQueueGroup = (RenderQueueGroupID)reader.ReadVariableUInt32();
     ReflectionLevel = (ReflectionLevels)reader.ReadVariableUInt32();
     PhysicsHeight = reader.ReadSingle();
     DeepColor = reader.ReadColorValue();
     ShallowColor = reader.ReadColorValue();
     ReflectionColor = reader.ReadColorValue();
     ReflectionTextureSize = (ReflectionTextureSizes)reader.ReadVariableUInt32();
     FixedPipelineMap = reader.ReadString();
     FixedPipelineMapTiling = reader.ReadSingle();
     FixedPipelineColor = reader.ReadColorValue();
 }
开发者ID:CITS4242B2010,项目名称:project2010,代码行数:16,代码来源:WaterPlane.cs

示例8: Client_ReceiveCreateSplash

 void Client_ReceiveCreateSplash( RemoteEntityWorld sender, ReceiveDataReader reader )
 {
     WaterPlaneType.SplashTypes splashType = (WaterPlaneType.SplashTypes)reader.
         ReadVariableUInt32();
     Vec3 pos = reader.ReadVec3();
     if( !reader.Complete() )
         return;
     CreateSplash( splashType, pos );
 }
开发者ID:CITS4242B2010,项目名称:project2010,代码行数:9,代码来源:WaterPlane.cs

示例9: Client_ReceiveHitCall

        private void Client_ReceiveHitCall(RemoteEntityWorld sender, ReceiveDataReader reader)
        {
            Vec3 hitPosition = reader.ReadVec3();
            string hitShapeBodyName = reader.ReadString();
            string hitShapeName = reader.ReadString();
            Vec3 hitNormal = reader.ReadVec3();
            MapObject hitMapObject = Entities.Instance.GetByNetworkUIN(reader.ReadVariableUInt32()) as MapObject;
            if (!reader.Complete())
                return;

            Position = hitPosition;
            Shape hitShape = null;
            if (PhysicsModel != null)
            {
                Body body = PhysicsModel.GetBody(hitShapeBodyName);
                if (body != null)
                    hitShape = body.GetShape(hitShapeName);
            }
            OnHit(hitShape, hitNormal, hitMapObject);
        }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:20,代码来源:Bullet.cs

示例10: Server_ReceiveTurnToPosition

        void Server_ReceiveTurnToPosition( RemoteEntityWorld sender, ReceiveDataReader reader )
        {
            //check to ensure that other players can not send messages to another player
            if( !Server_CheckRemoteEntityWorldAssociatedWithThisIntellect( sender ) )
                return;

            Vec3 value = reader.ReadVec3();
            if( !reader.Complete() )
                return;

            UpdateTurnToPositionForUnits( value );
        }
开发者ID:DarrenHassan,项目名称:GDM4242-GroupD,代码行数:12,代码来源:PlayerIntellect.cs


注:本文中的ReceiveDataReader.ReadVec3方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。