Exemple #1
0
        internal void SetActualDepth(Entity entity)
        {
            const double theta = .000001f;

            double add = 0;

            if (actualDepthLookup.TryGetValue(entity.depth, out add))
            {
                actualDepthLookup[entity.depth] += theta;
            }
            else
            {
                actualDepthLookup.Add(entity.depth, theta);
            }
            entity.actualDepth = entity.depth - add;

            //Mark lists unsorted
            Entities.MarkUnsorted();
            for (int i = 0; i < BitTag.TotalTags; i++)
            {
                if (entity.TagCheck(1 << i))
                {
                    TagLists.MarkUnsorted(i);
                }
            }
        }
Exemple #2
0
        public virtual void BeforeUpdate()
        {
            if (!Paused)
            {
                TimeActive += Engine.DeltaTime;
            }
            RawTimeActive += Engine.RawDeltaTime;

            Entities.UpdateLists();
            TagLists.UpdateLists();
            RendererList.UpdateLists();
        }
Exemple #3
0
        public Scene()
        {
            Tracker      = new Tracker();
            Entities     = new EntityList(this);
            TagLists     = new TagLists();
            RendererList = new RendererList(this);

            actualDepthLookup = new Dictionary <int, double>();

            HelperEntity = new Entity();
            Entities.Add(HelperEntity);
        }