當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。