예제 #1
0
 public OctreeManager(IContextState context, AxisAlignedBox box, int MaximumChildren,
                      RenderLoopSynchronizationContext syncContext) : base(box, MaximumChildren)
 {
     this.context         = context;
     IsDrawingBoxesEnable = false;
     loker      = new object();
     sync       = new SynchronizationContextAdapter <OctreeManager, SyncData>(this, syncContext);
     drawerTask = Task.CompletedTask;
 }
예제 #2
0
        public static GenneralContextState Full(ContextStateProcessor processor, AxisAlignedBox octreeBounds,
                                                EngineNotificator notificator, ILabLogger logger)
        {
            var syncContext = new RenderLoopSynchronizationContext();
            var octree      = new OctreeManager(processor, octreeBounds, 5, syncContext);

            notificator.Subscribe(octree);
            var geoPool = new GeometryPool(notificator, syncContext);

            notificator.Subscribe(geoPool);

            return(new GenneralContextState(processor, octree, geoPool, notificator, syncContext, logger));
        }
예제 #3
0
        public ManagerContainer(IManagerChangeNotify notify,
                                IOctreeManager octree, IContextState context, IGeometryMemoryPool geoPool,
                                RenderLoopSynchronizationContext syncContext, ILabLogger logger)
        {
            SynchronizationContext = syncContext;
            EntityOrder            = new EntityOrderContainer();
            this.SystemManager     = new SystemManager(notify, context);
            var encom = new EntityComponentManager(notify, EntityOrder, syncContext);

            GeoMemoryPool         = geoPool;
            this.ComponentManager = encom;
            this.EntityManager    = encom;
            OctreeManager         = octree;
            Logger = logger;
        }
예제 #4
0
 public GeometryPool(IManagerChangeNotify notify, RenderLoopSynchronizationContext syncContext)
 {
     sync        = SynchronizationContextBuilder.Create <GeometryPool, GeometryPoolComponent>(this, syncContext);
     pool        = new ConcurrentDictionary <Guid, IGeometryData>();
     this.notify = notify;
 }
예제 #5
0
 public static ISynchronizationQueue <TOwner, TInput> Create <TOwner, TInput>(TOwner owner, RenderLoopSynchronizationContext context)
 {
     return(new SynchronizationContextAdapter <TOwner, TInput>(owner, context));
 }
예제 #6
0
 GenneralContextState(ContextStateProcessor processor, IOctreeManager octree,
                      IGeometryMemoryPool geoPool, EngineNotificator notificator,
                      RenderLoopSynchronizationContext context, ILabLogger logger)
     : base(processor, new ManagerContainer(notificator, octree, processor, geoPool, context, logger))
 {
 }