Exemplo n.º 1
0
        public BoctModel()
        {
            _head          = new Boct();
            _regions       = new Dictionary <int, BoctRegion>();
            _materialList  = new BoctMaterialList();
            _extensionList = new BoctExtensionList();
            CenterAddress  = new List <byte>();

            RegionStream = new Subject <BoctRegion>();

            SolidBounds = new Bounds(Vector3.zero, Vector3.one);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Clone an instance.
        /// </summary>
        public BoctMaterialList(BoctMaterialList list) : this()
        {
            var materials = list.Materials;

            if (materials == null)
            {
                throw new BoctException("Material is null.");
            }

            foreach (var kv in materials)
            {
                _materials[kv.Key] = new BoctMaterial(kv.Value);
            }
        }
Exemplo n.º 3
0
        public BoctModel(BoctModelData data) : this()
        {
            GUID = data.GUID;

            Info = data.Info;

            foreach (var region in data.Regions)
            {
                AddRegion(region);
            }

            _materialList = new BoctMaterialList(data.MaterialList);

            UpdateSolidBounds();
        }
Exemplo n.º 4
0
        public Dictionary <int, int> Merge(BoctMaterialList list)
        {
            var conversionTable = new Dictionary <int, int>();

            foreach (var kv0 in list.Materials)
            {
                var m       = kv0.Value;
                var sameMat = GetSameColorMaterial(m);
                if (sameMat == null)
                {
                    var newMat = AddNewMaterial(m);
                    conversionTable.Add(m.LUID, newMat.LUID);
                }
                else
                {
                    conversionTable.Add(m.LUID, m.LUID);
                }
            }

            return(conversionTable);
        }