AoMEngineLibrary.Graphics.Brg.BrgBinaryReader.ReadVector3D C# (CSharp) Method

ReadVector3D() public method

public ReadVector3D ( bool isAom = true, bool isHalf = false ) : Vector3D
isAom bool
isHalf bool
return Vector3D
        public Vector3D ReadVector3D(bool isAom = true, bool isHalf = false)
        {
            Vector3D v = new Vector3D();

            if (isAom)
            {
                if (!isHalf)
                {
                    v.X = this.ReadSingle();
                    v.Y = this.ReadSingle();
                    v.Z = this.ReadSingle();
                }
                else
                {
                    v.X = this.ReadHalf();
                    v.Y = this.ReadHalf();
                    v.Z = this.ReadHalf();
                }
            }
            else
            {
                if (!isHalf)
                {
                    v.X = -this.ReadSingle();
                    v.Z = -this.ReadSingle();
                    v.Y = this.ReadSingle();
                }
                else
                {
                    v.X = -this.ReadHalf();
                    v.Z = -this.ReadHalf();
                    v.Y = this.ReadHalf();
                }
            }

            return v;
        }

Usage Example

 public BrgMeshHeader(BrgBinaryReader reader)
 {
     this.Version = reader.ReadInt16();
     this.Format = (BrgMeshFormat)reader.ReadInt16();
     this.NumVertices = reader.ReadInt16();
     this.NumFaces = reader.ReadInt16();
     this.InterpolationType = (BrgMeshInterpolationType)reader.ReadByte();
     this.AnimationType = (BrgMeshAnimType)reader.ReadByte();
     this.UserDataEntryCount = reader.ReadInt16();
     this.CenterPosition = reader.ReadVector3D(true, false);
     this.CenterRadius = reader.ReadSingle();
     this.MassPosition = reader.ReadVector3D(true, false);
     this.HotspotPosition = reader.ReadVector3D(true, false);
     this.ExtendedHeaderSize = reader.ReadInt16();
     this.Flags = (BrgMeshFlag)reader.ReadInt16();
     this.MinimumExtent = reader.ReadVector3D(true, false);
     this.MaximumExtent = reader.ReadVector3D(true, false);
 }
All Usage Examples Of AoMEngineLibrary.Graphics.Brg.BrgBinaryReader::ReadVector3D