Пример #1
0
        public static WorldModelHeader Read(Stream s)
        {
            var r   = new BinaryReader(s);
            var ret = new WorldModelHeader();

            ret.CountMaterials = r.ReadUInt32();
            ret.CountGroups    = r.ReadUInt32();
            ret.CountPortals   = r.ReadUInt32();
            ret.CountLights    = r.ReadUInt32();
            ret.CountModels    = r.ReadUInt32();
            ret.CountDoodads   = r.ReadUInt32();
            ret.CountSets      = r.ReadUInt32();
            ret.AmbientColor   = r.ReadUInt32();
            ret.WmoId          = r.ReadUInt32();
            ret.BoundingBox    = new Vector3[2];
            ret.BoundingBox[0] = Vector3Helper.Read(s);
            ret.BoundingBox[1] = Vector3Helper.Read(s);
            ret.ExtraFlag      = r.ReadUInt16();

            /*
             * _t flag_attenuate_vertices_based_on_distance_to_portal : 1;
             * uint16_t flag_skip_base_color : 1; // do not add base (ambient) color (of MOHD) to MOCVs. apparently does more, e.g. required for multiple MOCVs
             * uint16_t flag_liquid_related : 1; // fills the whole WMO with water (used for underwater WMOs). (possibly - LiquidType related, see below in the MLIQ).
             * uint16_t flag_has_some_outdoor_group : 1; // possibly - has some group that is outdoors
             * uint16_t Flag_Lod : 1;
             */
            ret.numLod = r.ReadUInt16();
            return(ret);
        }
Пример #2
0
        private void ReadHeader()
        {
            var chunk = Data.GetChunkByName("MOHD");

            if (chunk == null)
            {
                return;
            }

            var stream = chunk.GetStream();

            Header = WorldModelHeader.Read(stream);
        }
Пример #3
0
 public static WorldModelHeader Read(Stream s)
 {
     var r = new BinaryReader(s);
     var ret = new WorldModelHeader();
     ret.CountMaterials = r.ReadUInt32();
     ret.CountGroups = r.ReadUInt32();
     ret.CountPortals = r.ReadUInt32();
     ret.CountLights = r.ReadUInt32();
     ret.CountModels = r.ReadUInt32();
     ret.CountDoodads = r.ReadUInt32();
     ret.CountSets = r.ReadUInt32();
     ret.AmbientColorUnk = r.ReadUInt32();
     ret.WmoId = r.ReadUInt32();
     ret.BoundingBox = new Vector3[2];
     ret.BoundingBox[0] = Vector3Helper.Read(s);
     ret.BoundingBox[1] = Vector3Helper.Read(s);
     ret.LiquidTypeRelated = r.ReadUInt32();
     return ret;
 }
Пример #4
0
        public static WorldModelHeader Read(Stream s)
        {
            var r   = new BinaryReader(s);
            var ret = new WorldModelHeader();

            ret.CountMaterials    = r.ReadUInt32();
            ret.CountGroups       = r.ReadUInt32();
            ret.CountPortals      = r.ReadUInt32();
            ret.CountLights       = r.ReadUInt32();
            ret.CountModels       = r.ReadUInt32();
            ret.CountDoodads      = r.ReadUInt32();
            ret.CountSets         = r.ReadUInt32();
            ret.AmbientColorUnk   = r.ReadUInt32();
            ret.WmoId             = r.ReadUInt32();
            ret.BoundingBox       = new Vector3[2];
            ret.BoundingBox[0]    = Vector3Helper.Read(s);
            ret.BoundingBox[1]    = Vector3Helper.Read(s);
            ret.LiquidTypeRelated = r.ReadUInt32();
            return(ret);
        }