Example #1
0
 private void MergeLODT(AssetLODT asset)
 {
     foreach (Asset a in assetDictionary.Values)
     {
         if (a is AssetLODT LODT)
         {
             LODT.Merge(asset);
             return;
         }
     }
 }
Example #2
0
        public void Merge(AssetLODT asset)
        {
            var entries = LODT_Entries.ToList();

            foreach (var entry in asset.LODT_Entries)
            {
                entries.Remove(entry);
                entries.Add(entry);
            }

            LODT_Entries = entries.ToArray();
        }
        public override bool ShouldDraw(SharpRenderer renderer)
        {
            if (AssetMODL.renderBasedOnLodt)
            {
                if (AssetTPIK.tpikEntries.ContainsKey(PickupHash))
                {
                    var tpikEntry = AssetTPIK.tpikEntries[PickupHash].Model_AssetID;
                    if (GetDistanceFrom(renderer.Camera.Position) < AssetLODT.MaxDistanceTo(tpikEntry))
                    {
                        return(renderer.frustum.Intersects(ref boundingBox));
                    }
                }

                return(base.ShouldDraw(renderer));
            }

            return(renderer.frustum.Intersects(ref boundingBox));
        }
Example #4
0
        public void Merge(AssetLODT assetLODT)
        {
            List <EntryLODT> entriesLODT            = LODT_Entries.ToList();
            List <uint>      assetIDsAlreadyPresent = new List <uint>();

            foreach (EntryLODT entryLODT in entriesLODT)
            {
                assetIDsAlreadyPresent.Add(entryLODT.ModelAssetID);
            }

            foreach (EntryLODT entryLODT in assetLODT.LODT_Entries)
            {
                if (!assetIDsAlreadyPresent.Contains(entryLODT.ModelAssetID))
                {
                    entriesLODT.Add(entryLODT);
                }
            }

            LODT_Entries = entriesLODT.ToArray();
        }