예제 #1
0
        /// <summary>
        /// Add entity to its rendering queue.
        /// </summary>
        /// <param name="entity">Entity to push to queue.</param>
        /// <param name="world">World transformations.</param>
        public static void AddEntity(BaseRenderableEntity entity, Matrix world)
        {
            // special case - skip debug if not in debug mode
            if (entity.RenderingQueue == RenderingQueue.Debug && !GeonBitMain.Instance.DebugMode)
            {
                return;
            }

            // add to the rendering queue
            _renderingQueues[(int)entity.RenderingQueue].Entities.Add(new EntityInQueue(entity, world));
        }
예제 #2
0
        /// <summary>
        /// Render a renderable entity.
        /// Will either render immediately, or add to the corresponding rendering queue.
        /// </summary>
        /// <param name="entity">Entity to render.</param>
        /// <param name="world">World matrix for the entity.</param>
        public static void DrawEntity(BaseRenderableEntity entity, Matrix world)
        {
            // if no queue, draw immediately and return
            if (entity.RenderingQueue == RenderingQueue.NoQueue)
            {
                entity.DoEntityDraw(ref world);
                return;
            }

            // add to the rendering queue
            RenderingQueues.AddEntity(entity, world);
        }
예제 #3
0
 /// <summary>
 /// Create the entity-in-queue entry.
 /// </summary>
 /// <param name="entity">Entity to draw.</param>
 /// <param name="world">World transformations.</param>
 public EntityInQueue(BaseRenderableEntity entity, Matrix world)
 {
     Entity = entity;
     World  = world;
 }