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


C# BinaryWriter.WriteVector3f方法代码示例

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


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

示例1: Serialize

        public byte[] Serialize()
        {
            using (MemoryStream ms = new MemoryStream())
            {
                using (BinaryWriter bw = new BinaryWriter(ms))
                {
                    bw.Write((uint)this.Flags);
                    bw.WriteVector3f(this.Position);

                    bw.Write(this.GlobalStartRadius);
                    bw.Write(this.GlobalEndRadius);

                    bw.Write(this.LandFog.Serialize());
                    bw.Write(this.UnderwaterFog.Serialize());
                }

                return ms.ToArray();
            }
        }
开发者ID:Nihlus,项目名称:libwarcraft,代码行数:19,代码来源:ModelFogInstance.cs

示例2: Serialize

        public byte[] Serialize()
        {
            using (MemoryStream ms = new MemoryStream())
            {
                using (BinaryWriter bw = new BinaryWriter(ms))
                {
                    foreach (Vector3f visibleVertex in this.VisibleVertices)
                    {
                        bw.WriteVector3f(visibleVertex);
                    }
                }

                return ms.ToArray();
            }
        }
开发者ID:Nihlus,项目名称:libwarcraft,代码行数:15,代码来源:ModelVisibleVertices.cs

示例3: Serialize

        public byte[] Serialize()
        {
            using (MemoryStream ms = new MemoryStream())
            {
                using (BinaryWriter bw = new BinaryWriter(ms))
                {
                    byte[] nameOffsetBytes = BitConverter.GetBytes(this.NameOffset);
                    byte[] finalNameOffsetBytes = new byte[3];
                    Buffer.BlockCopy(nameOffsetBytes, 0, finalNameOffsetBytes, 0, 3);

                    bw.Write(finalNameOffsetBytes);
                    bw.Write((byte)this.Flags);

                    bw.WriteVector3f(this.Position);

                    // TODO: Investigate whether or not this is a Quat16 in >= BC
                    bw.WriteQuaternion32(this.Orientation);
                    bw.Write(this.Scale);
                    bw.WriteBGRA(this.StaticLightingColour);
                }

                return ms.ToArray();
            }
        }
开发者ID:Nihlus,项目名称:libwarcraft,代码行数:24,代码来源:ModelDoodadInstance.cs

示例4: Serialize

        public byte[] Serialize()
        {
            using (MemoryStream ms = new MemoryStream())
            {
                using (BinaryWriter bw = new BinaryWriter(ms))
                {
                    foreach (Vector3f normal in this.Normals)
                    {
                        bw.WriteVector3f(normal);
                    }
                }

                return ms.ToArray();
            }
        }
开发者ID:Nihlus,项目名称:libwarcraft,代码行数:15,代码来源:ModelNormals.cs

示例5: Serialize

        public byte[] Serialize()
        {
            using (MemoryStream ms = new MemoryStream())
            {
                using (BinaryWriter bw = new BinaryWriter(ms))
                {
                    bw.Write((byte)this.Type);

                    bw.Write(this.bUseAttenuation);
                    bw.Write(this.bUseUnknown1);
                    bw.Write(this.bUseUnknown2);

                    bw.WriteBGRA(this.Colour);
                    bw.WriteVector3f(this.Position);
                    bw.Write(this.Intensity);

                    bw.Write(this.AttenuationStartRadius);
                    bw.Write(this.AttenuationEndRadius);

                    bw.Write(this.Unknown1StartRadius);
                    bw.Write(this.Unknown1EndRadius);

                    bw.Write(this.Unknown2StartRadius);
                    bw.Write(this.Unknown2EndRadius);
                }

                return ms.ToArray();
            }
        }
开发者ID:Nihlus,项目名称:libwarcraft,代码行数:29,代码来源:ModelStaticLighting.cs

示例6: Serialize

        public byte[] Serialize()
        {
            using (MemoryStream ms = new MemoryStream())
            {
                using (BinaryWriter bw = new BinaryWriter(ms))
                {
                    bw.Write(this.WidthVertices);
                    bw.Write(this.HeightVertices);

                    bw.Write(this.WidthTileFlags);
                    bw.Write(this.HeightTileFlags);

                    bw.WriteVector3f(this.Location);
                    bw.Write(this.MaterialIndex);

                    foreach (LiquidVertex liquidVertex in this.LiquidVertices)
                    {
                        bw.Write(liquidVertex.Serialize());
                    }

                    foreach (LiquidFlags liquidFlag in this.LiquidTileFlags)
                    {
                        bw.Write((byte)liquidFlag);
                    }
                }

                return ms.ToArray();
            }
        }
开发者ID:Nihlus,项目名称:libwarcraft,代码行数:29,代码来源:ModelLiquids.cs


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