public void GrowByVertex(Vector3 vertex)
 {
     if (vertex[0] < this.px1)
     {
         this.px1 = vertex[0];
     }
     if (vertex[0] > this.px2)
     {
         this.px2 = vertex[0];
     }
     if (vertex[1] < this.py1)
     {
         this.py1 = vertex[1];
     }
     if (vertex[1] > this.py2)
     {
         this.py2 = vertex[1];
     }
     if (vertex[2] < this.pz1)
     {
         this.pz1 = vertex[2];
     }
     if (vertex[2] > this.pz2)
     {
         this.pz2 = vertex[2];
     }
 }
 public NiGeometryData()
 {
     this.unknownInt = 0;
     this.numVertices = (ushort)0;
     this.keepFlags = (byte)0;
     this.compressFlags = (byte)0;
     this.hasVertices = false;
     this.vertices = new List<Vector3>();
     this.bsNumUVSets = (ushort)0;
     this.skyrimMaterial = 0U;
     this.hasNormals = false;
     this.normals = new List<Vector3>();
     this.tangents = new List<Vector3>();
     this.bitangents = new List<Vector3>();
     this.center = new Vector3();
     this.radius = 0.0f;
     this.hasVertexColors = false;
     this.vertexColors = new List<Color4>();
     this.uvCoords = new List<UVCoord>();
     this.consistencyFlags = (ushort)0;
     this.additionalData = -1;
 }
 public void SetPosition(Vector3 value)
 {
     this.position = value;
 }
 public void SetExtent(Vector3 value)
 {
     this.extent = value;
 }
 public override void Read(NiHeader header, BinaryReader reader)
 {
     base.Read(header, reader);
     this.position = Utils.ReadVector3(reader);
     this.extent = Utils.ReadVector3(reader);
 }
 public BSMultiBoundAABB()
 {
     this.position = new Vector3();
     this.extent = new Vector3();
 }
 public static void WriteVector3(BinaryWriter writer, Vector3 value)
 {
     writer.Write(value[0]);
     writer.Write(value[1]);
     writer.Write(value[2]);
 }
 public bool VertexInSquare(Vector3 vertex)
 {
     if (vertex[0] >= this.px1 && vertex[0] <= this.px2 && vertex[1] >= this.py1 && vertex[1] <= this.py2)
     {
         return true;
     }
     return false;
 }
 public bool VertexInBox(Vector3 vertex)
 {
     if (vertex[0] >= this.px1 && vertex[0] <= this.px2 && vertex[1] >= this.py1 && vertex[1] <= this.py2 && vertex[3] >= this.pz1 && vertex[3] <= this.pz2)
     {
         return true;
     }
     return false;
 }
 public void SetCenter(Vector3 value)
 {
     this.center = value;
 }
 public override void Read(NiHeader header, BinaryReader reader)
 {
     base.Read(header, reader);
     this.unknownInt = reader.ReadInt32();
     this.numVertices = reader.ReadUInt16();
     this.keepFlags = reader.ReadByte();
     this.compressFlags = reader.ReadByte();
     this.hasVertices = Utils.ReadBool(reader);
     if (this.hasVertices)
     {
         for (int index = 0; index < (int)this.numVertices; ++index)
             this.vertices.Add(Utils.ReadVector3(reader));
     }
     this.bsNumUVSets = reader.ReadUInt16();
     if (header.GetUserVersion() == 12U)
         this.skyrimMaterial = reader.ReadUInt32();
     this.hasNormals = Utils.ReadBool(reader);
     if (this.hasNormals)
     {
         for (int index = 0; index < (int)this.numVertices; ++index)
             this.normals.Add(Utils.ReadVector3(reader));
         if ((int)this.bsNumUVSets >= 4096)
         {
             for (int index = 0; index < (int)this.numVertices; ++index)
                 this.tangents.Add(Utils.ReadVector3(reader));
             for (int index = 0; index < (int)this.numVertices; ++index)
                 this.bitangents.Add(Utils.ReadVector3(reader));
         }
     }
     this.center = Utils.ReadVector3(reader);
     this.radius = reader.ReadSingle();
     this.hasVertexColors = Utils.ReadBool(reader);
     if (this.hasVertexColors)
     {
         for (int index = 0; index < (int)this.numVertices; ++index)
             this.vertexColors.Add(Utils.ReadColor4(reader));
     }
     if (((int)this.bsNumUVSets & 1) == 1)
     {
         for (int index = 0; index < (int)this.numVertices; ++index)
             this.uvCoords.Add(Utils.ReadUVCoord(reader));
     }
     this.consistencyFlags = reader.ReadUInt16();
     this.additionalData = reader.ReadInt32();
 }