示例#1
0
        public GraphicsClass()
        {
            InitObjectStack     = new Dictionary <int, IRenderer>();
            Profile             = new Profiler();
            Assets              = new Dictionary <int, IRenderer>();
            selectionBox        = new RenderBoundingBox();
            translokatorGrid    = new SpatialGrid();
            navigationGrids     = new SpatialGrid[0];
            OurPrimitiveManager = new PrimitiveManager();

            OnSelectedObjectUpdated += OnSelectedObjectHasUpdated;

            // Create bespoke batches for any lines or boxes passed in via the construct stack
            string LineBatchID = string.Format("Graphics_LineBatcher_{0}", RefManager.GetNewRefID());

            LineBatch = new PrimitiveBatch(PrimitiveType.Line, LineBatchID);

            string BBoxBatchID = string.Format("Graphics_BBoxBatcher_{0}", RefManager.GetNewRefID());

            BBoxBatch = new PrimitiveBatch(PrimitiveType.Box, BBoxBatchID);

            OurPrimitiveManager.AddPrimitiveBatch(LineBatch);
            OurPrimitiveManager.AddPrimitiveBatch(BBoxBatch);
        }