Beispiel #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);
                }
            }
        }
Beispiel #2
0
        public virtual void BeforeUpdate()
        {
            TimeActive += Engine.DeltaTime;

            Entities.UpdateLists();
            TagLists.UpdateLists();
        }
Beispiel #3
0
        public virtual void BeforeUpdate()
        {
            if (!Paused)
            {
                TimeActive += Engine.DeltaTime;
            }
            RawTimeActive += Engine.RawDeltaTime;

            Entities.UpdateLists();
            TagLists.UpdateLists();
            RendererList.UpdateLists();
        }
Beispiel #4
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);
        }
Beispiel #5
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();
            foreach (var tag in entity.Tags)
            {
                TagLists.MarkUnsorted(tag);
            }
        }